close.tsx 606 B

123456789101112131415161718192021222324252627
  1. import { useTranslation } from 'react-i18next'
  2. import MaterialIcon from '@/shared/components/material-icon'
  3. type CloseProps = {
  4. onDismiss: React.MouseEventHandler<HTMLButtonElement>
  5. variant?: 'light' | 'dark'
  6. }
  7. function Close({ onDismiss, variant = 'light' }: CloseProps) {
  8. const { t } = useTranslation()
  9. return (
  10. <button
  11. type="button"
  12. className={`close float-end ${variant}`}
  13. onClick={onDismiss}
  14. >
  15. <MaterialIcon
  16. type="close"
  17. className="align-text-bottom"
  18. accessibilityLabel={t('close')}
  19. />
  20. </button>
  21. )
  22. }
  23. export default Close