From a430284aa21e3ae1f0d5654e55b2ad2852519cc2 Mon Sep 17 00:00:00 2001 From: wwf <yearningwang@iqtogether.com> Date: 星期三, 04 六月 2025 15:17:49 +0800 Subject: [PATCH] 初始化 --- app/components/datasets/create/top-bar/index.tsx | 22 ++++++++-------------- 1 files changed, 8 insertions(+), 14 deletions(-) diff --git a/app/components/datasets/create/top-bar/index.tsx b/app/components/datasets/create/top-bar/index.tsx index c5d8921..20ba715 100644 --- a/app/components/datasets/create/top-bar/index.tsx +++ b/app/components/datasets/create/top-bar/index.tsx @@ -1,13 +1,12 @@ -import { type FC, useMemo } from 'react' +import type { FC } from 'react' import { RiArrowLeftLine } from '@remixicon/react' import Link from 'next/link' import { useTranslation } from 'react-i18next' import { Stepper, type StepperProps } from '../stepper' import classNames from '@/utils/classnames' -export type TopBarProps = Pick<StepperProps, 'activeIndex'> & { +export type TopbarProps = Pick<StepperProps, 'activeIndex'> & { className?: string - datasetId?: string } const STEP_T_MAP: Record<number, string> = { @@ -16,25 +15,20 @@ 3: 'datasetCreation.steps.three', } -export const TopBar: FC<TopBarProps> = (props) => { - const { className, datasetId, ...rest } = props +export const Topbar: FC<TopbarProps> = (props) => { + const { className, ...rest } = props const { t } = useTranslation() - - const fallbackRoute = useMemo(() => { - return datasetId ? `/datasets/${datasetId}/documents` : '/datasets' - }, [datasetId]) - return <div className={classNames('flex shrink-0 h-[52px] items-center justify-between relative border-b border-b-divider-subtle', className)}> - <Link href={fallbackRoute} replace className="inline-flex h-12 items-center justify-start gap-1 py-2 pl-2 pr-6"> + <Link href={'/datasets'} className="h-12 pl-2 pr-6 py-2 justify-start items-center gap-1 inline-flex"> <div className='p-2'> <RiArrowLeftLine className='size-4 text-text-primary' /> </div> - <p className="system-sm-semibold-uppercase text-text-primary"> - {t('datasetCreation.steps.header.fallbackRoute')} + <p className="text-text-primary system-sm-semibold-uppercase"> + {t('datasetCreation.steps.header.creation')} </p> </Link> <div className={ - 'absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2' + 'top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 absolute' }> <Stepper steps={Array.from({ length: 3 }, (_, i) => ({ -- Gitblit v1.8.0