You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

actions.tsx 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. type ActionsProps = {
  7. disabled?: boolean
  8. handleNextStep: () => void
  9. }
  10. const Actions = ({
  11. disabled,
  12. handleNextStep,
  13. }: ActionsProps) => {
  14. const { t } = useTranslation()
  15. const { datasetId } = useParams()
  16. return (
  17. <div className='flex justify-end gap-x-2'>
  18. <a
  19. href={`/datasets/${datasetId}/documents`}
  20. >
  21. <Button
  22. variant='ghost'
  23. className='px-3 py-2'
  24. >
  25. {t('common.operation.cancel')}
  26. </Button>
  27. </a>
  28. <Button
  29. disabled={disabled}
  30. variant='primary'
  31. onClick={handleNextStep}
  32. className='gap-x-0.5'
  33. >
  34. <span className='px-0.5'>{t('datasetCreation.stepOne.button')}</span>
  35. <RiArrowRightLine className='size-4' />
  36. </Button>
  37. </div>
  38. )
  39. }
  40. export default React.memo(Actions)