- Add migrations 019/020: extend Person (first/last name, nickname, is_favourite, company, job_title, mobile, category) and Location (is_frequent, contact_number, email) - Update Person/Location models, schemas, and routers with new fields + name denormalisation - Create shared component library: EntityTable, EntityDetailPanel, CategoryFilterBar, CopyableField, CategoryAutocomplete, useTableVisibility hook - Rebuild LocationsPage: table layout with sortable columns, detail side panel, category filter bar, frequent pinned section - Extend LocationForm with contact number, email, frequent toggle, category autocomplete - Add animated panel transitions to ProjectDetail (55/45 split with cubic-bezier easing) - Update TypeScript interfaces for Person and Location Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
14 lines
551 B
TypeScript
14 lines
551 B
TypeScript
const FALLBACK = 'bg-gray-500/10 text-gray-400 border-gray-500/20';
|
|
|
|
export function getCategoryColor(category: string | undefined): string {
|
|
if (!category) return FALLBACK;
|
|
const colors: Record<string, string> = {
|
|
home: 'bg-blue-500/10 text-blue-400 border-blue-500/20',
|
|
work: 'bg-purple-500/10 text-purple-400 border-purple-500/20',
|
|
restaurant: 'bg-orange-500/10 text-orange-400 border-orange-500/20',
|
|
shop: 'bg-green-500/10 text-green-400 border-green-500/20',
|
|
other: FALLBACK,
|
|
};
|
|
return colors[category] ?? FALLBACK;
|
|
}
|