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.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import React from 'react'
  2. import { RiArrowLeftLine } from '@remixicon/react'
  3. import Button from '@/app/components/base/button'
  4. import { useParams } from 'next/navigation'
  5. import Effect from '@/app/components/base/effect'
  6. import { useAddDocumentsSteps } from './hooks'
  7. import StepIndicator from './step-indicator'
  8. type LeftHeaderProps = {
  9. title: string
  10. currentStep: number
  11. }
  12. const LeftHeader = ({
  13. title,
  14. currentStep,
  15. }: LeftHeaderProps) => {
  16. const { datasetId } = useParams()
  17. const steps = useAddDocumentsSteps()
  18. return (
  19. <div className='relative flex flex-col gap-y-0.5 pb-2 pt-4'>
  20. <div className='flex items-center gap-x-2'>
  21. <span className='system-2xs-semibold-uppercase bg-pipeline-add-documents-title-bg bg-clip-text text-transparent'>
  22. {title}
  23. </span>
  24. <span className='system-2xs-regular text-divider-regular'>/</span>
  25. <StepIndicator steps={steps} currentStep={currentStep} />
  26. </div>
  27. <div className='system-md-semibold text-text-primary'>
  28. {steps[currentStep - 1]?.label}
  29. </div>
  30. <a
  31. className='absolute -left-11 top-3.5'
  32. href={`/datasets/${datasetId}/documents`}
  33. >
  34. <Button variant='secondary-accent' className='size-9 rounded-full p-0'>
  35. <RiArrowLeftLine className='size-5 ' />
  36. </Button>
  37. </a>
  38. <Effect className='left-8 top-[-34px] opacity-20' />
  39. </div>
  40. )
  41. }
  42. export default React.memo(LeftHeader)