footer.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import React, { type FC } from 'react'
  2. import type { TimePickerFooterProps } from '../types'
  3. import Button from '../../button'
  4. import { useTranslation } from 'react-i18next'
  5. const Footer: FC<TimePickerFooterProps> = ({
  6. handleSelectCurrentTime,
  7. handleConfirm,
  8. }) => {
  9. const { t } = useTranslation()
  10. return (
  11. <div className='flex justify-end items-center p-2 border-t-[0.5px] border-divider-regular'>
  12. <div className='flex items-center gap-x-1'>
  13. {/* Now */}
  14. <button
  15. type='button'
  16. className='flex items-center justify-center px-1.5 py-1 text-components-button-secondary-accent-text system-xs-medium'
  17. onClick={handleSelectCurrentTime}
  18. >
  19. <span className='px-[3px]'>{t('time.operation.now')}</span>
  20. </button>
  21. {/* Confirm Button */}
  22. <Button
  23. variant='primary'
  24. size='small'
  25. className='w-16 px-1.5 py-1'
  26. onClick={handleConfirm.bind(null)}
  27. >
  28. {t('time.operation.ok')}
  29. </Button>
  30. </div>
  31. </div>
  32. )
  33. }
  34. export default React.memo(Footer)