From 373cd418993ee3e7f813e6330be62c36c37392e9 Mon Sep 17 00:00:00 2001 From: Jurgis Sakalauskas Date: Tue, 14 Oct 2025 16:55:53 +0300 Subject: [PATCH] more prices --- .../src/pages/project-detail/project-items-utils.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/client/src/pages/project-detail/project-items-utils.ts b/client/src/pages/project-detail/project-items-utils.ts index a5b4636..53b4cc2 100644 --- a/client/src/pages/project-detail/project-items-utils.ts +++ b/client/src/pages/project-detail/project-items-utils.ts @@ -122,9 +122,8 @@ export const formatPriceAmount = (amount: number, currency: string | null): stri export const getPriceSummaryDisplay = ( summary: Item['priceSummary'] | null ): { primary: string; secondary: string | null } => { - console.log(summary); if (!summary || summary.priceCount === 0) { - return { primary: '—', secondary: null }; + return { primary: 'Add Price', secondary: null }; } const resolveCurrency = (preferred: string | null) => preferred ?? summary.currency ?? null; @@ -138,12 +137,16 @@ export const getPriceSummaryDisplay = ( if (!count) { return null; } + const conditionLabel = condition === 'new' ? 'New' : 'Used'; if (amount === null || hasMixedCurrency) { - return `${condition} prices vary (${count})`; + return `${conditionLabel} prices vary (${count})`; } const resolvedCurrency = resolveCurrency(currency); const formatted = formatPriceAmount(amount, resolvedCurrency); - return `${condition} from ${formatted} (${count})`; + if (count === 1) { + return `${conditionLabel} ${formatted}`; + } + return `${conditionLabel} from ${formatted} (${count})`; }; const newLabel = formatConditionLabel(