diff --git a/src/routes/contacts.index.tsx b/src/routes/contacts.index.tsx index 4d342b0..ef908dd 100644 --- a/src/routes/contacts.index.tsx +++ b/src/routes/contacts.index.tsx @@ -14,6 +14,21 @@ import { Plus, Search, Mail, Phone, Building2, ChevronRight, Edit, Trash2, Brief import { ContactFormDialog, CONTACT_TYPES, type ContactRecord } from "@/components/contacts/contact-form-dialog"; import { setArchived } from "@/lib/archive"; +type Category = "all" | "companies" | "people" | "lawyers"; + +const CATEGORY_TYPES: Record, string[]> = { + lawyers: ["opposing_counsel", "co_counsel"], + companies: ["vendor", "court"], + people: ["expert", "witness", "process_server", "client_contact", "other"], +}; + +function categoryOf(type: string | null | undefined): Exclude { + const t = type ?? "other"; + if (CATEGORY_TYPES.lawyers.includes(t)) return "lawyers"; + if (CATEGORY_TYPES.companies.includes(t)) return "companies"; + return "people"; +} + export const Route = createFileRoute("/contacts/")({ component: () => (