From fe4720eaadf2e57efc0a4c94fd95825b3482bfc5 Mon Sep 17 00:00:00 2001 From: Reece Browne Date: Tue, 26 Aug 2025 11:56:57 +0100 Subject: [PATCH] Handle thumbnail edge case --- .../components/pageEditor/FileThumbnail.tsx | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/pageEditor/FileThumbnail.tsx b/frontend/src/components/pageEditor/FileThumbnail.tsx index 609a31e1a..5836dc33f 100644 --- a/frontend/src/components/pageEditor/FileThumbnail.tsx +++ b/frontend/src/components/pageEditor/FileThumbnail.tsx @@ -13,7 +13,7 @@ interface FileItem { id: string; name: string; pageCount: number; - thumbnail: string; + thumbnail: string | null; size: number; splitBefore?: boolean; } @@ -193,15 +193,16 @@ const FileThumbnail = ({ boxShadow: '2px 2px 0 rgba(0,0,0,0.1), 4px 4px 0 rgba(0,0,0,0.05)' }} > - {file.name} { - // Hide broken image if blob URL was revoked - const img = e.target as HTMLImageElement; - img.style.display = 'none'; - }} + {file.thumbnail && ( + {file.name} { + // Hide broken image if blob URL was revoked + const img = e.target as HTMLImageElement; + img.style.display = 'none'; + }} style={{ maxWidth: '100%', maxHeight: '100%', @@ -209,6 +210,7 @@ const FileThumbnail = ({ borderRadius: 2, }} /> + )} {/* Page count badge - only show for PDFs */}