import React, { useState } from 'react'; import { Box, type BoxProps, Flex, Textarea, useTheme } from '@chakra-ui/react'; import MyRadio from '@/components/Radio/index'; import dynamic from 'next/dynamic'; import ManualImport from './Import/Manual'; const ChunkImport = dynamic(() => import('./Import/Chunk'), { ssr: true }); const QAImport = dynamic(() => import('./Import/QA'), { ssr: true }); const CsvImport = dynamic(() => import('./Import/Csv'), { ssr: true }); enum ImportTypeEnum { manual = 'manual', index = 'index', qa = 'qa', csv = 'csv' } const ImportData = ({ kbId }: { kbId: string }) => { const theme = useTheme(); const [importType, setImportType] = useState<`${ImportTypeEnum}`>(ImportTypeEnum.manual); const TitleStyle: BoxProps = { fontWeight: 'bold', fontSize: ['md', 'xl'], mb: [3, 5] }; return ( 数据导入方式 setImportType(e as `${ImportTypeEnum}`)} /> {importType === ImportTypeEnum.manual && } {importType === ImportTypeEnum.index && } {importType === ImportTypeEnum.qa && } {importType === ImportTypeEnum.csv && } ); }; export default ImportData;