+ + {o.productLabel} + {" "} + {o.packageLabel} +
+ ) : null} +
+
+ {o.unitPriceMinor === null ? ( + {t.noConversion} + ) : ( + formatUnitPrice(o.unitPriceMinor, typeUnit) + )} +
++ {formatMoney(o.price.priceMinor)} + {o.diffPct ? ` · ${t.diff(o.diffPct)}` : ""} +
+{t.noPrices}
+ ) : ( +
+
+ {ymdLabel(r.date)} + {r.isPromo + ? ` · ${r.promoEnded ? t.promoEnded : t.promo}${ + r.promoUntil ? ` (${t.promoUntil(ymdLabel(r.promoUntil))})` : "" + }` + : ""} + {` · ${t.sources[r.source.split(":")[0]!] ?? r.source}`} + {r.note ? ` · ${r.note}` : ""} +
+{formatMoney(r.priceMinor)}
+ {r.unitPriceMinor !== null ? ( ++ {formatUnitPrice(r.unitPriceMinor, p.typeUnit)} +
+ ) : null} +{t.noProducts}
+ ) : data.offers.length === 0 ? ( +{t.noPrices}
+ ) : ( +{p.label}
++ + {p.label} + +
{p.packageLabel}
{showType ? (
diff --git a/src/features/stock/components/stock-analysis-view.tsx b/src/features/stock/components/stock-analysis-view.tsx
index 448ef5d..ad5b380 100644
--- a/src/features/stock/components/stock-analysis-view.tsx
+++ b/src/features/stock/components/stock-analysis-view.tsx
@@ -4,6 +4,8 @@ import { PageHeader } from "@/components/page-header";
import { Button } from "@/components/ui/button";
import { tr } from "@/i18n/tr";
import { cn } from "@/lib/utils";
+import { formatDate, formatMoney } from "@/shared/format";
+import { formatUnitPrice } from "@/shared/prices";
import { formatStock } from "@/shared/stock";
import type { StockAnalysis, StockAnalysisRow } from "../service";
@@ -72,6 +74,7 @@ function Num({ value, unit, tone }: { value: number | null; unit: string; tone?:
export function StockAnalysisView({ data }: { data: StockAnalysis }) {
const groups = new Map
{t.totalCost(formatMoney(totalCost))}
: null}+ + {t.avgCost} + + + {r.avgMonthlyCostMinor === null + ? t.noData + : formatMoney(r.avgMonthlyCostMinor)} + +
{t.avgWasted}