From 18fa62514a4dd98d0d2db71ee7c3d318e4778815 Mon Sep 17 00:00:00 2001 From: seb Date: Wed, 21 Oct 2026 00:33:36 +0200 Subject: [PATCH] u --- src/routes/artikel.jsx | 256 ++++++++++++++++++----------------------- 1 file changed, 115 insertions(+), 141 deletions(-) diff --git a/src/routes/artikel.jsx b/src/routes/artikel.jsx index 9076f6f..39582f9 100644 --- a/src/routes/artikel.jsx +++ b/src/routes/artikel.jsx @@ -57,31 +57,21 @@ import { SCRIM_LABEL } from '../colors'; // #region Styles & Measure Sample const resultRowSx = { alignItems: 'center', - minHeight: 64, - maxHeight: 64, - height: 64, + minHeight: 40, + maxHeight: 40, + height: 40, boxSizing: 'border-box', py: 0, + gap: 1.25, // Keep every row one line so sample height matches real rows. '& .MuiListItemText-root': { minWidth: 0, my: 0 }, - '& .MuiListItemText-primary': { - overflow: 'hidden', - textOverflow: 'ellipsis', - whiteSpace: 'nowrap', - lineHeight: '22px', - height: '22px', - display: 'flex', - alignItems: 'center', - }, - '& .MuiListItemText-secondary': { - overflow: 'hidden', - textOverflow: 'ellipsis', - whiteSpace: 'nowrap', - lineHeight: '20px', - height: '20px', - display: 'flex', - alignItems: 'center', - }, +}; + +const resultCellSx = { + flexShrink: 0, + whiteSpace: 'nowrap', + overflow: 'hidden', + textOverflow: 'ellipsis', }; /** @@ -112,16 +102,8 @@ class ResultRow extends Component { disabled sx={{ ...resultRowSx, pointerEvents: 'none', userSelect: 'none', opacity: 0 }} > - - -   - + +   ); } @@ -139,120 +121,112 @@ class ResultRow extends Component { onMouseDown={(e) => e.preventDefault()} onClick={() => onOpenArticle?.(row)} sx={resultRowSx} + title={row.sku} > - + {row.smallThumbBinary && ( - - {row.name} - - {showChildBadge && ( - - {childCount} - - )} - - } - secondary={ - - {(row.brand?.name || row.brandName) ? ( - - - · - - ) : null} - - {row.sku} - - - · - - 0 - ? row.warehouses.map((w) => `${w.name || 'Lager'}: ${formatStock(w.stock)}`).join(' · ') - : undefined - } - > - Bestand {formatStock(row.stock)} - - {row.categories ? ( - - {` · ${formatCategoryList(row.categories, categoryFacets ?? {})}`} - - ) : null} - - } - slotProps={{ primary: { fontWeight: 500, noWrap: true } }} - /> + component="img" + alt="" + src={`data:image/avif;base64,${row.smallThumbBinary}`} + sx={{ width: '100%', height: '100%', objectFit: 'cover', display: 'block' }} + /> + )} + 0 + ? row.warehouses.map((w) => `${w.name || 'Lager'}: ${formatStock(w.stock)}`).join(' · ') + : undefined + } + > + {formatStock(row.stock)} + + {row.categories ? ( + + {formatCategoryList(row.categories, categoryFacets ?? {})} + + ) : null} + {(row.brand?.name || row.brandName) ? ( + + + + ) : null} + + + {row.name} + + {showChildBadge && ( + + {childCount} + + )} + + {price != null ? formatPrice(price) : '—'}