mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-14 21:50:56 -05:00
6437059783
[web] BS5 system notifications GitOrigin-RevId: a5a17a418193e325c0f561708c99240191cff8e7
34 lines
901 B
TypeScript
34 lines
901 B
TypeScript
import { useTranslation } from 'react-i18next'
|
|
import MaterialIcon from '@/shared/components/material-icon'
|
|
import BootstrapVersionSwitcher from '@/features/ui/components/bootstrap-5/bootstrap-version-switcher'
|
|
|
|
type CloseProps = {
|
|
onDismiss: React.MouseEventHandler<HTMLButtonElement>
|
|
variant?: 'light' | 'dark'
|
|
}
|
|
|
|
function Close({ onDismiss, variant = 'light' }: CloseProps) {
|
|
const { t } = useTranslation()
|
|
|
|
return (
|
|
<button
|
|
type="button"
|
|
className={`close pull-right ${variant}`}
|
|
onClick={onDismiss}
|
|
>
|
|
<BootstrapVersionSwitcher
|
|
bs3={<span aria-hidden="true">×</span>}
|
|
bs5={
|
|
<MaterialIcon
|
|
type="close"
|
|
className="align-text-bottom"
|
|
accessibilityLabel={t('close')}
|
|
/>
|
|
}
|
|
/>
|
|
<span className="sr-only">{t('close')}</span>
|
|
</button>
|
|
)
|
|
}
|
|
|
|
export default Close
|