2022-09-13 09:57:47 -04:00
|
|
|
import { useTranslation } from 'react-i18next'
|
2024-08-28 05:10:46 -04:00
|
|
|
import MaterialIcon from '@/shared/components/material-icon'
|
|
|
|
import BootstrapVersionSwitcher from '@/features/ui/components/bootstrap-5/bootstrap-version-switcher'
|
2022-09-13 09:57:47 -04:00
|
|
|
|
|
|
|
type CloseProps = {
|
2022-10-12 10:52:53 -04:00
|
|
|
onDismiss: React.MouseEventHandler<HTMLButtonElement>
|
2023-08-29 15:04:45 -04:00
|
|
|
variant?: 'light' | 'dark'
|
2022-10-12 10:52:53 -04:00
|
|
|
}
|
2022-09-13 09:57:47 -04:00
|
|
|
|
2023-08-29 15:04:45 -04:00
|
|
|
function Close({ onDismiss, variant = 'light' }: CloseProps) {
|
2022-09-13 09:57:47 -04:00
|
|
|
const { t } = useTranslation()
|
|
|
|
|
|
|
|
return (
|
2023-08-29 15:04:45 -04:00
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
className={`close pull-right ${variant}`}
|
|
|
|
onClick={onDismiss}
|
|
|
|
>
|
2024-08-28 05:10:46 -04:00
|
|
|
<BootstrapVersionSwitcher
|
|
|
|
bs3={<span aria-hidden="true">×</span>}
|
|
|
|
bs5={
|
|
|
|
<MaterialIcon
|
|
|
|
type="close"
|
|
|
|
className="align-text-bottom"
|
|
|
|
accessibilityLabel={t('close')}
|
|
|
|
/>
|
|
|
|
}
|
|
|
|
/>
|
2022-10-12 10:52:53 -04:00
|
|
|
<span className="sr-only">{t('close')}</span>
|
|
|
|
</button>
|
2022-09-13 09:57:47 -04:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Close
|