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} - - - )} - - )} - +