From 20a2e76f4047651953e143152f58bb3e0e316971 Mon Sep 17 00:00:00 2001 From: AkaraChen Date: Mon, 9 Dec 2024 15:43:34 +0800 Subject: [PATCH] feat: file selector for preview in parent child --- .../datasets/create/step-two/index.tsx | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/web/app/components/datasets/create/step-two/index.tsx b/web/app/components/datasets/create/step-two/index.tsx index fb2994cd26..8cba952ef6 100644 --- a/web/app/components/datasets/create/step-two/index.tsx +++ b/web/app/components/datasets/create/step-two/index.tsx @@ -19,7 +19,6 @@ import { indexMethodIcon } from '../icons' import { PreviewContainer } from '../../preview/container' import { ChunkContainer, QAPreview } from '../../chunk' import { PreviewHeader } from '../../preview/header' -import DocumentPicker from '../../common/document-picker' import { FormattedText } from '../../formatted-text/formatted' import { PreviewSlice } from '../../formatted-text/flavours/preview-slice' import s from './index.module.css' @@ -58,6 +57,7 @@ import { getNotionInfo, getWebsiteInfo, useCreateDocument, useCreateFirstDocumen import Badge from '@/app/components/base/badge' import { SkeletonContanier, SkeletonPoint, SkeletonRectangle, SkeletonRow } from '@/app/components/base/skeleton' import Tooltip from '@/app/components/base/tooltip' +import Select from '@/app/components/base/select' const TextLabel: FC = (props) => { return @@ -168,6 +168,8 @@ const StepTwo = ({ : IndexingType.ECONOMICAL, ) + const [previewFileName, setPreviewFileName] = useState() + // QA Related const [isLanguageSelectDisabled, setIsLanguageSelectDisabled] = useState(false) const [docForm, setDocForm] = useState( @@ -227,7 +229,9 @@ const StepTwo = ({ docForm, docLanguage, dataSourceType: DataSourceType.FILE, - files, + files: previewFileName + ? [files.find(file => file.name === previewFileName)!] + : files, indexingTechnique: getIndexing_technique() as any, processRule: getProcessRule(), dataset_id: datasetId!, @@ -928,7 +932,19 @@ const StepTwo = ({ title='Preview' >
- +