diff --git a/VoidCat/spa/src/FilePreview.js b/VoidCat/spa/src/FilePreview.js index 41f2313..ab4b5ad 100644 --- a/VoidCat/spa/src/FilePreview.js +++ b/VoidCat/spa/src/FilePreview.js @@ -58,6 +58,29 @@ export function FilePreview() { return null; } + function renderOpenGraphTags() { + let tags = [ + , + , + , + + ]; + + const mime = info?.metadata?.mimeType; + if (mime?.startsWith("image/")) { + tags.push(); + tags.push(); + } else if (mime?.startsWith("video/")) { + tags.push(); + tags.push(); + } else if (mime?.startsWith("audio/")) { + tags.push(); + tags.push(); + } + + return tags; + } + useEffect(() => { loadInfo(); }, []); @@ -82,6 +105,7 @@ export function FilePreview() { void.cat - {info.metadata?.name} + {renderOpenGraphTags()} {info.metadata?.name ?? info.id} {renderTypes()}