fix(web): restore preview panel rendering for all file types

The home-page preview panel always rendered ImageViewer regardless of the
uploaded file's modality, causing videos, audio, PDFs, and data files to
show "Preview not available". Root cause: the preview branching only
checked for a blob URL and assumed all files were images.

Fix: branch on currentEntry.previewKind so the existing MediaPlayerView,
DocumentView, and a file-info fallback are activated for their respective
modalities. Also widen the AppLayout dropzone from image-only to all file
types so non-image files can reach the home page in the first place.
This commit is contained in:
SnapOtter
2026-06-13 15:19:58 +08:00
parent 8adceaf92d
commit 1181b1fe22
2 changed files with 36 additions and 4 deletions
@@ -148,7 +148,9 @@ export function AppLayout({
className={cn("flex-1 flex flex-col overflow-hidden", isMobile && "pt-12 pb-20")}
>
<div className="flex-1 overflow-y-auto p-6 flex items-center justify-center">
{children || <Dropzone onFiles={onFiles} onUrlImport={onUrlImport} accept="image/*" />}
{children || (
<Dropzone onFiles={onFiles} onUrlImport={onUrlImport} fileFilter={() => true} />
)}
</div>
</main>