2025-10-21 23:45:04 +00:00
|
|
|
import type { OpenedFile } from "@fileone/convex/filesystem"
|
2025-10-04 14:09:25 +00:00
|
|
|
import { ImagePreviewDialog } from "./image-preview-dialog"
|
|
|
|
|
|
|
|
|
|
export function FilePreviewDialog({
|
2025-10-21 23:45:04 +00:00
|
|
|
openedFile,
|
2025-10-04 14:09:25 +00:00
|
|
|
onClose,
|
|
|
|
|
}: {
|
2025-10-21 23:45:04 +00:00
|
|
|
openedFile: OpenedFile
|
2025-10-04 14:09:25 +00:00
|
|
|
onClose: () => void
|
|
|
|
|
}) {
|
2025-10-21 23:45:04 +00:00
|
|
|
switch (openedFile.file.mimeType) {
|
2025-10-04 14:09:25 +00:00
|
|
|
case "image/jpeg":
|
|
|
|
|
case "image/png":
|
|
|
|
|
case "image/gif":
|
2025-10-21 23:45:04 +00:00
|
|
|
return (
|
|
|
|
|
<ImagePreviewDialog openedFile={openedFile} onClose={onClose} />
|
|
|
|
|
)
|
2025-10-04 14:09:25 +00:00
|
|
|
default:
|
|
|
|
|
return null
|
|
|
|
|
}
|
|
|
|
|
}
|