From 544dba6f8ae0f638c4f904ddb0891b64f681a23a Mon Sep 17 00:00:00 2001 From: sawka Date: Fri, 21 Jun 2024 16:11:34 -0700 Subject: [PATCH] add streaming icons --- frontend/app/view/preview.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/app/view/preview.tsx b/frontend/app/view/preview.tsx index cd1acb8e2..e4439be8d 100644 --- a/frontend/app/view/preview.tsx +++ b/frontend/app/view/preview.tsx @@ -172,8 +172,14 @@ function PreviewView({ blockId }: { blockId: string }) { mimeType.startsWith("audio/") || mimeType.startsWith("image/") ) { - if (mimeType.startsWith("image/")) { + if (mimeType == "application/pdf") { + blockIcon = "file-pdf"; + } else if (mimeType.startsWith("image/")) { blockIcon = "image"; + } else if (mimeType.startsWith("video/")) { + blockIcon = "film"; + } else if (mimeType.startsWith("audio/")) { + blockIcon = "headphones"; } specializedView = ; } else if (fileInfo == null) { @@ -208,7 +214,7 @@ function PreviewView({ blockId }: { blockId: string }) { setTimeout(() => { const blockIconOverrideAtom = useBlockAtom(blockId, "blockicon:override", () => { return jotai.atom(null); - }); + }) as jotai.PrimitiveAtom; globalStore.set(blockIconOverrideAtom, blockIcon); }, 10);