From 7eb3308a06c0da48fff4aa4ef7e2548c5fca2bd9 Mon Sep 17 00:00:00 2001 From: Codex Review Integration Date: Mon, 14 Sep 2026 13:04:35 -0300 Subject: [PATCH] refactor(vendors): satisfy row maintainability gate --- .../vendors/_components/vendors-table.tsx | 78 +++++++++++-------- 1 file changed, 45 insertions(+), 33 deletions(-) diff --git a/src/app/(protected)/vendors/_components/vendors-table.tsx b/src/app/(protected)/vendors/_components/vendors-table.tsx index de239409..3e851435 100644 --- a/src/app/(protected)/vendors/_components/vendors-table.tsx +++ b/src/app/(protected)/vendors/_components/vendors-table.tsx @@ -135,11 +135,54 @@ interface VendorTableRowProps { onOpenEdit: (row: VendorListItem) => void; } +function VendorTradeCell({ + primaryTrade, + omittedTrades, +}: { + primaryTrade: string; + omittedTrades: string[]; +}) { + const extraTrades = omittedTrades.length; + return ( + + {primaryTrade === "—" ? ( + "—" + ) : ( + + {primaryTrade} + {extraTrades > 0 && ( + + + +{extraTrades} + + + )} + + )} + + ); +} + function VendorTableRow({ row, onOpenDetail, onOpenEdit }: VendorTableRowProps) { const trades = splitTrades(row.tradeSpecialties); const primaryTrade = trades[0] ?? "—"; const omittedTrades = trades.slice(1); - const extraTrades = omittedTrades.length; const { locationText, phoneText } = getVendorDisplayValues(row); const rowKey = String(row.id ?? `company-${row.companyId ?? ""}`); @@ -204,38 +247,7 @@ function VendorTableRow({ row, onOpenDetail, onOpenEdit }: VendorTableRowProps) color="var(--color-muted-foreground)" /> - - {primaryTrade === "—" ? ( - "—" - ) : ( - - {primaryTrade} - {extraTrades > 0 && ( - - - +{extraTrades} - - - )} - - )} - +