From a33188c5676faddbcc1f892e5b43d48ea681f520 Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 03:54:22 +0000 Subject: [PATCH] Changes Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com> --- src/routes/contacts.index.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/routes/contacts.index.tsx b/src/routes/contacts.index.tsx index 5794b48..456bf98 100644 --- a/src/routes/contacts.index.tsx +++ b/src/routes/contacts.index.tsx @@ -99,14 +99,13 @@ function ContactsIndex() { const archivedCount = rows.filter((r) => r.archived_at).length; const activeCount = rows.length - archivedCount; - const categoryCounts = useMemo(() => { + const typeCounts = useMemo(() => { const base = rows.filter((r) => (view === "archived" ? !!r.archived_at : !r.archived_at)); - return { - all: base.length, - companies: base.filter((r) => categoryOf(r.contact_type) === "companies").length, - people: base.filter((r) => categoryOf(r.contact_type) === "people").length, - lawyers: base.filter((r) => categoryOf(r.contact_type) === "lawyers").length, - }; + const counts: Record = { all: base.length }; + for (const t of CONTACT_TYPES) { + counts[t.value] = base.filter((r) => (r.contact_type ?? "other") === t.value).length; + } + return counts; }, [rows, view]); const remove = async (id: string, name: string) => {