Changes
Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
co-authored by
renee-png
parent
de1e0cd702
commit
a33188c567
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user