add-another.tsx 797 B

123456789101112131415161718192021222324252627282930313233
  1. import React, { type FC } from 'react'
  2. import { useTranslation } from 'react-i18next'
  3. import classNames from '@/utils/classnames'
  4. import Checkbox from '@/app/components/base/checkbox'
  5. type AddAnotherProps = {
  6. className?: string
  7. isChecked: boolean
  8. onCheck: () => void
  9. }
  10. const AddAnother: FC<AddAnotherProps> = ({
  11. className,
  12. isChecked,
  13. onCheck,
  14. }) => {
  15. const { t } = useTranslation()
  16. return (
  17. <div className={classNames('flex items-center gap-x-1 pl-1', className)}>
  18. <Checkbox
  19. key='add-another-checkbox'
  20. className='shrink-0'
  21. checked={isChecked}
  22. onCheck={onCheck}
  23. />
  24. <span className='text-text-tertiary system-xs-medium'>{t('datasetDocuments.segment.addAnother')}</span>
  25. </div>
  26. )
  27. }
  28. export default React.memo(AddAnother)