2022-09-13 09:57:47 -04:00
|
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
|
|
|
|
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}
|
|
|
|
>
|
2022-10-12 10:52:53 -04:00
|
|
|
<span aria-hidden="true">×</span>
|
|
|
|
<span className="sr-only">{t('close')}</span>
|
|
|
|
</button>
|
2022-09-13 09:57:47 -04:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Close
|