Shows an uploaded file by its type, in a card or on a dump's page. Audio and video play in the global player or inline.
f
FilePreview(unnamed 0: FilePreviewProps): React.JSX.Element
Renders an uploaded file by its MIME type. Compact, it is a thumbnail or an icon. Full size, it is the image, a player, the embedded PDF, or a download link for anything else. File URLs carry the viewer's media token, so private files load too.
I
FilePreviewProps
Passed to FilePreview by DumpCard (compact), by Dump (global)
and by DumpEdit (neither).
-
compact: boolean
Shows a card's thumbnail, whose play button uses the global player.
-
dump: Dump
Expected to be a file dump. A link dump has no
fileMime, so it shows as a download. -
global: boolean
Plays full-size audio and video in the global player, not inline.
Usage
import * as mod from "src/components/dump/FilePreview.tsx";