feat: support batch upload files (#419)

This commit is contained in:
Joel
2023-06-21 09:44:01 +08:00
committed by GitHub
parent 8a4d19d9ba
commit d637a147ee
10 changed files with 288 additions and 226 deletions

View File

@@ -9,7 +9,6 @@ import { fetchFilePreview } from '@/service/common'
type IProps = {
file?: File
notionPage?: any
hidePreview: () => void
}
@@ -33,14 +32,15 @@ const FilePreview = ({
const getFileName = (currentFile?: File) => {
if (!currentFile)
return ''
const arr = currentFile.name.split('.')
return arr.slice(0, -1).join()
}
useEffect(() => {
if (file)
if (file) {
setLoading(true)
getPreviewContent(file.id)
}
}, [file])
return (