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.

left-header.tsx 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import React, { useCallback } from 'react'
  2. import { RiArrowLeftLine } from '@remixicon/react'
  3. import Button from '@/app/components/base/button'
  4. import { useRouter } from 'next/navigation'
  5. import Effect from '@/app/components/base/effect'
  6. import { useTranslation } from 'react-i18next'
  7. type LeftHeaderProps = {
  8. title: string
  9. }
  10. const LeftHeader = ({
  11. title,
  12. }: LeftHeaderProps) => {
  13. const { t } = useTranslation()
  14. const { back } = useRouter()
  15. const navigateBack = useCallback(() => {
  16. back()
  17. }, [back])
  18. return (
  19. <div className='relative flex flex-col gap-y-0.5 pb-2 pt-4'>
  20. <div className='system-2xs-semibold-uppercase bg-pipeline-add-documents-title-bg bg-clip-text text-transparent'>
  21. {title}
  22. </div>
  23. <div className='system-md-semibold text-text-primary'>
  24. {t('datasetPipeline.addDocuments.steps.processDocuments')}
  25. </div>
  26. <Button
  27. variant='secondary-accent'
  28. className='absolute -left-11 top-3.5 size-9 rounded-full p-0'
  29. onClick={navigateBack}
  30. >
  31. <RiArrowLeftLine className='size-5 ' />
  32. </Button>
  33. <Effect className='left-8 top-[-34px] opacity-20' />
  34. </div>
  35. )
  36. }
  37. export default React.memo(LeftHeader)