fix(catalog): show real material names, not categories, across quote views

New shared materialLabel() renders the global materials.name with brand/specs
appended only when not already part of the name (deduped; «؟» fallback kept).
Replaces the category-first composer in five places: supplier card badges
(CategoryPage), dashboard item lines (QuoteCard), ledger items summary,
project rows and purchase history. Also fixes the stale Units subtitle
«ضریب تبدیل همان دسته» → «ضریب تبدیل متریال» (category model kept).
This commit is contained in:
2026-09-06 19:03:35 +03:30
parent 1f123a0a05
commit fd1831b3fc
6 changed files with 26 additions and 14 deletions
+2 -3
View File
@@ -5,7 +5,7 @@ import {
isExpired,
itemsSummary,
materialById,
materialSpecs,
materialLabel,
projectCell,
quoteTotal,
supplierById,
@@ -165,11 +165,10 @@ export function QuoteCard({ store, q, expanded, onToggleExpand, onAccept, onEdit
<div className="flex flex-col gap-1 text-[11.5px] leading-5 text-muted">
{store.quotes.find((x) => x.id === q.id)?.line_items?.filter((li) => !li.rejected).map((li) => {
const m = materialById(store.materials, li.material_id);
const specs = materialSpecs(m);
return (
<span key={li.id} className="flex items-center gap-1">
<span className="h-1.5 w-1.5 shrink-0 rounded-full bg-accent/40" />
{m.category} {m.brand}{specs.length ? ` · ${specs.join(" · ")}` : ""}
{materialLabel(m)}
<span className="text-[10px] text-muted/70">
{fmtNum(li.quantity)} {li.unit}
</span>