From 43d27cfd2784c7d33117f422a929b685c7558726 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Wed, 15 Oct 2025 16:56:34 +0200 Subject: [PATCH] thumbnails --- frontend/src/documents/DocumentsTable.jsx | 28 ++++++++++++----------- frontend/src/styles.css | 24 ++++++++++++++----- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/frontend/src/documents/DocumentsTable.jsx b/frontend/src/documents/DocumentsTable.jsx index 2597847..f778b56 100644 --- a/frontend/src/documents/DocumentsTable.jsx +++ b/frontend/src/documents/DocumentsTable.jsx @@ -67,19 +67,21 @@ const DocumentThumbnailImage = ({ document, ensureAssetUrl, getDocumentAsset, al [document, ensureAssetUrl, getDocumentAsset], ); - if (url) { - return ( - {alt event.preventDefault()} - /> - ); - } - - return
DOC
; + return ( +
+ {url ? ( + {alt event.preventDefault()} + /> + ) : ( +
DOC
+ )} +
+ ); }; const DocumentsTable = ({ diff --git a/frontend/src/styles.css b/frontend/src/styles.css index 529ebda..4351601 100644 --- a/frontend/src/styles.css +++ b/frontend/src/styles.css @@ -919,18 +919,29 @@ button.icon-button.ghost:hover:not([disabled]) { text-align: center; } -.document-thumbnail { - width: 36px; +.document-thumbnail-wrapper { + width: 48px; height: 48px; - object-fit: cover; - border-radius: 3px; + background: transparent; + display: inline-flex; + align-items: center; + justify-content: center; +} + +.document-thumbnail { + max-width: 100%; + max-height: 100%; + object-fit: contain; + background: var(--surface-subtle); + border-radius: 1px; box-shadow: 0 1px 3px var(--shadow-medium); } .thumb-placeholder { - width: 36px; - height: 48px; + width: 100%; + height: 100%; border-radius: 1px; + background: var(--surface-subtle); color: var(--muted); display: inline-flex; align-items: center; @@ -938,6 +949,7 @@ button.icon-button.ghost:hover:not([disabled]) { font-size: 0.68rem; font-weight: 600; letter-spacing: 0.08em; + box-shadow: 0 1px 3px var(--shadow-medium); } .thumb-placeholder.icon {