Commit d167ca32 authored by Joel's avatar Joel

feat: free plan not support bathch upload

parent 1308978d
......@@ -23,6 +23,7 @@ type IFileUploaderProps = {
onFileUpdate: (fileItem: FileItem, progress: number, list: FileItem[]) => void
onFileListUpdate?: (files: FileItem[]) => void
onPreview: (file: File) => void
notSupportBatchUpload?: boolean
}
const FileUploader = ({
......@@ -32,6 +33,7 @@ const FileUploader = ({
onFileUpdate,
onFileListUpdate,
onPreview,
notSupportBatchUpload,
}: IFileUploaderProps) => {
const { t } = useTranslation()
const { notify } = useContext(ToastContext)
......@@ -258,7 +260,7 @@ const FileUploader = ({
id="fileUploader"
style={{ display: 'none' }}
type="file"
multiple
multiple={!notSupportBatchUpload}
accept={ACCEPTS.join(',')}
onChange={fileChangeHandle}
/>
......
......@@ -39,7 +39,7 @@ export const NotionConnector = ({ onSetting }: NotionConnectorProps) => {
return (
<div className={s.notionConnectionTip}>
<span className={s.notionIcon}/>
<span className={s.notionIcon} />
<div className={s.title}>{t('datasetCreation.stepOne.notionSyncTitle')}</div>
<div className={s.tip}>{t('datasetCreation.stepOne.notionSyncTip')}</div>
<Button className='h-8' type='primary' onClick={onSetting}>{t('datasetCreation.stepOne.connect')}</Button>
......@@ -92,7 +92,7 @@ const StepOne = ({
const hasNotin = notionPages.length > 0
const isVectorSpaceFull = plan.usage.vectorSpace >= plan.total.vectorSpace
const isShowVectorSpaceFull = (allFileLoaded || hasNotin) && isVectorSpaceFull && enableBilling
const notSupportBatchUpload = enableBilling && plan.type === 'sandbox'
const nextDisabled = useMemo(() => {
if (!files.length)
return true
......@@ -169,6 +169,7 @@ const StepOne = ({
onFileListUpdate={updateFileList}
onFileUpdate={updateFile}
onPreview={updateCurrentFile}
notSupportBatchUpload={notSupportBatchUpload}
/>
{isShowVectorSpaceFull && (
<div className='max-w-[640px] mb-4'>
......
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