|
|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
import React from 'react'
|
|
|
|
|
import React, { useCallback } from 'react'
|
|
|
|
|
import { RiArrowLeftLine } from '@remixicon/react'
|
|
|
|
|
import Button from '@/app/components/base/button'
|
|
|
|
|
import { useParams } from 'next/navigation'
|
|
|
|
|
import { useParams, useRouter } from 'next/navigation'
|
|
|
|
|
import Effect from '@/app/components/base/effect'
|
|
|
|
|
import type { Step } from './step-indicator'
|
|
|
|
|
import StepIndicator from './step-indicator'
|
|
|
|
|
@ -18,6 +18,12 @@ const LeftHeader = ({
|
|
|
|
|
currentStep,
|
|
|
|
|
}: LeftHeaderProps) => {
|
|
|
|
|
const { datasetId } = useParams()
|
|
|
|
|
const { push } = useRouter()
|
|
|
|
|
|
|
|
|
|
const goBack = useCallback(() => {
|
|
|
|
|
if (datasetId)
|
|
|
|
|
push(`/datasets/${datasetId}/documents`)
|
|
|
|
|
}, [datasetId, push])
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className='relative flex flex-col gap-y-0.5 pb-2 pt-4'>
|
|
|
|
|
@ -32,14 +38,13 @@ const LeftHeader = ({
|
|
|
|
|
{steps[currentStep - 1]?.label}
|
|
|
|
|
</div>
|
|
|
|
|
{currentStep !== steps.length && (
|
|
|
|
|
<a
|
|
|
|
|
className='absolute -left-11 top-3.5'
|
|
|
|
|
href={`/datasets/${datasetId}/documents`}
|
|
|
|
|
<Button
|
|
|
|
|
variant='secondary-accent'
|
|
|
|
|
className='absolute -left-11 top-3.5 size-9 rounded-full p-0'
|
|
|
|
|
onClick={goBack}
|
|
|
|
|
>
|
|
|
|
|
<Button variant='secondary-accent' className='size-9 rounded-full p-0'>
|
|
|
|
|
<RiArrowLeftLine className='size-5 ' />
|
|
|
|
|
</Button>
|
|
|
|
|
</a>
|
|
|
|
|
<RiArrowLeftLine className='size-5 ' />
|
|
|
|
|
</Button>
|
|
|
|
|
)}
|
|
|
|
|
<Effect className='left-8 top-[-34px] opacity-20' />
|
|
|
|
|
</div>
|
|
|
|
|
|