feat: support batch upload files (#419)

This commit is contained in:
Joel 2023-06-21 09:44:01 +08:00 • committed by GitHub
commit d637a147ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 (