diff --git a/ondeck/src/app/(dashboard)/clients/[id]/page.tsx b/ondeck/src/app/(dashboard)/clients/[id]/page.tsx index d9657fb..9db7c59 100644 --- a/ondeck/src/app/(dashboard)/clients/[id]/page.tsx +++ b/ondeck/src/app/(dashboard)/clients/[id]/page.tsx @@ -40,6 +40,7 @@ export default async function ClientDetailPage({ id: true, name: true, _count: { select: { tasks: true, policies: true } }, + claimsAdvocate: { select: { id: true, displayName: true, email: true } }, }, orderBy: { name: 'asc' }, }, diff --git a/ondeck/src/components/clients/client-detail.tsx b/ondeck/src/components/clients/client-detail.tsx index 833775d..858e346 100644 --- a/ondeck/src/components/clients/client-detail.tsx +++ b/ondeck/src/components/clients/client-detail.tsx @@ -6,6 +6,12 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card' import { Badge } from '@/components/ui/badge' import { Button } from '@/components/ui/button' import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs' +import { + Dialog, + DialogContent, + DialogHeader, + DialogTitle, +} from '@/components/ui/dialog' import { Select, SelectContent, @@ -14,7 +20,7 @@ import { SelectValue, } from '@/components/ui/select' import { Textarea } from '@/components/ui/textarea' -import { Building2, MapPin, Phone, Mail, FileText, CheckSquare, CalendarRange, Users, X, Plus, UserCheck, StickyNote, Pencil, Trash2, ChevronDown, ChevronUp, ArrowUp, ArrowDown, ArrowUpDown } from 'lucide-react' +import { Building2, MapPin, Phone, Mail, FileText, CheckSquare, CalendarRange, Users, X, Plus, UserCheck, StickyNote, Pencil, Trash2, ChevronDown, ChevronUp, ArrowUp, ArrowDown, ArrowUpDown, GitBranch, ChevronRight } from 'lucide-react' import { Combobox } from '@/components/ui/combobox' import { formatDate, formatRenewalDate } from '@/lib/utils' import { PolicyGroupManager } from '@/components/clients/policy-group-manager' @@ -53,6 +59,7 @@ export function ClientDetail({ client, designations, policyGroups = [], allPolic const [parentOptions, setParentOptions] = useState<{id:string;name:string}[]>([]) const [parentLinking, setParentLinking] = useState(false) const [showArchivedTasks, setShowArchivedTasks] = useState(false) + const [subsidiariesModalOpen, setSubsidiariesModalOpen] = useState(false) const [taskSort, setTaskSort] = useState<'date' | 'priority'>('date') const [taskSortDir, setTaskSortDir] = useState<'asc' | 'desc'>('asc') const [showCompleted, setShowCompleted] = useState(false) @@ -290,6 +297,9 @@ export function ClientDetail({ client, designations, policyGroups = [], allPolic } } + const isParent = subsidiaries.length > 0 + const isChild = !!parentClient + return (
{/* Header */} @@ -299,7 +309,7 @@ export function ClientDetail({ client, designations, policyGroups = [], allPolic {client.name} -
+
{client.city && client.state && (
@@ -319,9 +329,73 @@ export function ClientDetail({ client, designations, policyGroups = [], allPolic
)}
+ + {/* Parent / Child badges */} +
+ {isParent && ( + + )} + {isChild && ( + + + Child of {parentClient!.name} + + )} +
+ {/* Subsidiaries modal */} + + + + + + Subsidiaries of {client.name} + + +
+ {subsidiaries.map((sub: any) => ( + setSubsidiariesModalOpen(false)} + className="flex items-center justify-between rounded-lg border border-border p-3 hover:bg-muted/50 transition-colors group" + > +
+

{sub.name}

+ {sub.claimsAdvocate && ( +

+ Advocate: {sub.claimsAdvocate.displayName || sub.claimsAdvocate.email} +

+ )} +
+
+ + + {sub._count?.policies ?? 0} + + + + {sub._count?.tasks ?? 0} + + +
+ + ))} +
+
+
+ {/* Client Notes — collapsible */}