Commit 380f25bb authored by StyleZhang's avatar StyleZhang

fix: dataset document add pages tip

parent 8a521916
...@@ -15,7 +15,7 @@ import { NotionPageSelector } from '@/app/components/base/notion-page-selector' ...@@ -15,7 +15,7 @@ import { NotionPageSelector } from '@/app/components/base/notion-page-selector'
type IStepOneProps = { type IStepOneProps = {
datasetId?: string datasetId?: string
dataSourceType: DataSourceType dataSourceType?: DataSourceType
dataSourceTypeDisable: Boolean dataSourceTypeDisable: Boolean
hasConnection: boolean hasConnection: boolean
onSetting: () => void onSetting: () => void
...@@ -77,17 +77,19 @@ const StepOne = ({ ...@@ -77,17 +77,19 @@ const StepOne = ({
setCurrentNotionPage(undefined) setCurrentNotionPage(undefined)
} }
const shouldShowDataSourceTypeList = !datasetId || (datasetId && !dataSourceType)
return ( return (
<div className='flex w-full h-full'> <div className='flex w-full h-full'>
<div className='grow overflow-y-auto relative'> <div className='grow overflow-y-auto relative'>
{ {
!datasetId && ( shouldShowDataSourceTypeList && (
<div className={s.stepHeader}>{t('datasetCreation.steps.one')}</div> <div className={s.stepHeader}>{t('datasetCreation.steps.one')}</div>
) )
} }
<div className={s.form}> <div className={s.form}>
{ {
!datasetId && ( shouldShowDataSourceTypeList && (
<div className={s.dataSourceTypeList}> <div className={s.dataSourceTypeList}>
<div <div
className={cn( className={cn(
...@@ -134,7 +136,7 @@ const StepOne = ({ ...@@ -134,7 +136,7 @@ const StepOne = ({
} }
{dataSourceType === DataSourceType.FILE && ( {dataSourceType === DataSourceType.FILE && (
<> <>
<FileUploader onFileUpdate={updateFile} file={file} titleClassName={datasetId && 'mt-[30px] !mb-[44px] !text-lg !font-semibold !text-gray-900'} /> <FileUploader onFileUpdate={updateFile} file={file} titleClassName={(!shouldShowDataSourceTypeList) ? 'mt-[30px] !mb-[44px] !text-lg !font-semibold !text-gray-900' : undefined} />
<Button disabled={!file} className={s.submitButton} type='primary' onClick={onStepChange}>{t('datasetCreation.stepOne.button')}</Button> <Button disabled={!file} className={s.submitButton} type='primary' onClick={onStepChange}>{t('datasetCreation.stepOne.button')}</Button>
</> </>
)} )}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment