From 8b69968b8fa2af074ea8484734c0597b8e803467 Mon Sep 17 00:00:00 2001 From: thislight Date: Mon, 11 Nov 2024 14:57:49 +0800 Subject: [PATCH] MediaAttachmentGrid: fix element type misuse --- src/timelines/MediaAttachmentGrid.tsx | 32 +++++++++++++-------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/timelines/MediaAttachmentGrid.tsx b/src/timelines/MediaAttachmentGrid.tsx index 625e0ab..682767a 100644 --- a/src/timelines/MediaAttachmentGrid.tsx +++ b/src/timelines/MediaAttachmentGrid.tsx @@ -3,6 +3,8 @@ import { type Component, For, Index, + Match, + Switch, createMemo, createRenderEffect, createSignal, @@ -147,9 +149,10 @@ const MediaAttachmentGrid: Component<{ > {(item, index) => { - switch (item().type) { - case "image": - return ( + const itemType = () => item().type; + return ( + + - ); - case "video": - return ( + + + + - ); - case "unknown": - return
; - } +
+
+ ); }}