Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

actions.tsx 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import React from 'react'
  2. import Button from '@/app/components/base/button'
  3. import { useTranslation } from 'react-i18next'
  4. import { useParams } from 'next/navigation'
  5. import { RiArrowRightLine } from '@remixicon/react'
  6. import Link from 'next/link'
  7. type ActionsProps = {
  8. disabled?: boolean
  9. handleNextStep: () => void
  10. }
  11. const Actions = ({
  12. disabled,
  13. handleNextStep,
  14. }: ActionsProps) => {
  15. const { t } = useTranslation()
  16. const { datasetId } = useParams()
  17. return (
  18. <div className='flex justify-end gap-x-2'>
  19. <Link
  20. href={`/datasets/${datasetId}/documents`}
  21. replace
  22. >
  23. <Button
  24. variant='ghost'
  25. className='px-3 py-2'
  26. >
  27. {t('common.operation.cancel')}
  28. </Button>
  29. </Link>
  30. <Button
  31. disabled={disabled}
  32. variant='primary'
  33. onClick={handleNextStep}
  34. className='gap-x-0.5'
  35. >
  36. <span className='px-0.5'>{t('datasetCreation.stepOne.button')}</span>
  37. <RiArrowRightLine className='size-4' />
  38. </Button>
  39. </div>
  40. )
  41. }
  42. export default React.memo(Actions)