Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-18 03:54:22 +00:00
co-authored by renee-png
parent de1e0cd702
commit a33188c567
+6 -7
View File
@@ -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<string, number> = { 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) => {