mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
fix: 文件预览
This commit is contained in:
@@ -45,6 +45,12 @@ export default function FilePreviewModal({
|
||||
}
|
||||
)
|
||||
|
||||
useEffect(() => {
|
||||
if (filePath) {
|
||||
run()
|
||||
}
|
||||
}, [filePath])
|
||||
|
||||
let contentElement = null
|
||||
if (!supportedPreviewExts.includes(ext)) {
|
||||
contentElement = <div>暂不支持预览此文件类型</div>
|
||||
@@ -68,12 +74,6 @@ export default function FilePreviewModal({
|
||||
)
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (filePath) {
|
||||
run()
|
||||
}
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<Modal isOpen={isOpen} onClose={onClose} scrollBehavior="inside" size="3xl">
|
||||
<ModalContent>
|
||||
|
@@ -58,6 +58,7 @@ export default function ImageNameButton({
|
||||
run()
|
||||
}
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<Button
|
||||
variant="light"
|
||||
@@ -69,7 +70,7 @@ export default function ImageNameButton({
|
||||
) : loading || !data ? (
|
||||
<Spinner size="sm" />
|
||||
) : (
|
||||
<Image src={data} alt={name} className="w-8 h-8" radius="sm" />
|
||||
<Image src={data} alt={name} className="w-8 h-8 flex-shrink-0" radius="sm" />
|
||||
)
|
||||
}
|
||||
>
|
||||
|
Reference in New Issue
Block a user