From 210cf505782cd294e92598a38572058d9c4c6a01 Mon Sep 17 00:00:00 2001 From: Jurgis Sakalauskas Date: Thu, 16 Oct 2025 10:22:50 +0300 Subject: [PATCH] show default image --- .../project-items-desktop-table.tsx | 19 ++-- .../project-items-mobile-list.tsx | 91 ++++++++++--------- server/src/db/items-repository.ts | 14 +++ shared/models/item.d.ts | 1 + 4 files changed, 77 insertions(+), 48 deletions(-) diff --git a/client/src/pages/project-detail/project-items-desktop-table.tsx b/client/src/pages/project-detail/project-items-desktop-table.tsx index 120b7bb..19ef675 100644 --- a/client/src/pages/project-detail/project-items-desktop-table.tsx +++ b/client/src/pages/project-detail/project-items-desktop-table.tsx @@ -3,6 +3,7 @@ import { ExternalLink } from 'lucide-react'; import type { Item } from '@shared/models/item'; import { ItemPricesPanel } from './item-prices-panel'; import { formatAttributeValue, getPriceSummaryDisplay } from './project-items-utils'; +import { ItemThumbnail } from './item-thumbnail'; interface ProjectItemsDesktopTableProps { items: Item[]; @@ -49,13 +50,18 @@ export function ProjectItemsDesktopTable({ const priceDisplay = getPriceSummaryDisplay(item.priceSummary); const isExpanded = expandedItemId === item.id; const panelId = `item-${item.id}-prices-desktop`; + const displayName = item.manufacturer + ? `${item.manufacturer} ${item.model}` + : item.model; return ( -
-
+
+ +
+
{item.sourceUrl ? ( @@ -85,9 +91,10 @@ export function ProjectItemsDesktopTable({ ) : null}
- {item.note ? ( - {item.note} - ) : null} + {item.note ? ( + {item.note} + ) : null} +
{visibleAttributes.map((attribute) => ( diff --git a/client/src/pages/project-detail/project-items-mobile-list.tsx b/client/src/pages/project-detail/project-items-mobile-list.tsx index 32e3547..8a8473a 100644 --- a/client/src/pages/project-detail/project-items-mobile-list.tsx +++ b/client/src/pages/project-detail/project-items-mobile-list.tsx @@ -2,6 +2,7 @@ import { ExternalLink } from 'lucide-react'; import type { Item } from '@shared/models/item'; import { ItemPricesPanel } from './item-prices-panel'; import { formatAttributeValue, getPriceSummaryDisplay } from './project-items-utils'; +import { ItemThumbnail } from './item-thumbnail'; interface ProjectItemsMobileListProps { items: Item[]; @@ -27,53 +28,59 @@ export function ProjectItemsMobileList({ const priceDisplay = getPriceSummaryDisplay(item.priceSummary); const isExpanded = expandedItemId === item.id; const panelId = `item-${item.id}-prices-mobile`; + const displayName = item.manufacturer ? `${item.manufacturer} ${item.model}` : item.model; return (
-
- - {item.sourceUrl ? ( - - - Open source link - - ) : null} -
- - {item.note ?

Note: {item.note}

: null} - -
- {visibleAttributes.map((attribute) => ( -
- - {attribute} - - {formatAttributeValue(attributes[attribute])} +
+ +
+
+ + {item.sourceUrl ? ( + + + Open source link + + ) : null}
- ))} + + {item.note ?

Note: {item.note}

: null} + +
+ {visibleAttributes.map((attribute) => ( +
+ + {attribute} + + + {formatAttributeValue(attributes[attribute])} + +
+ ))} +
+
-
+