/** * Client Dashboard - Level 2 (Client Dossier) * * Overzicht van client voortgang, recente activiteit en belangrijke metrics. * Dit is de hoofd-dashboard pagina die opent wanneer je een client selecteert. */ import { notFound } from 'next/navigation'; import { ChevronLeft } from 'lucide-react'; import Link from 'next/link'; import { getClient } from '../../actions'; import { transformClient } from '@/lib/types/client'; import { ClientTabs } from '../components/client-tabs'; interface ClientDashboardPageProps { params: Promise<{ id: string }>; searchParams: Promise<{ tab?: string }>; } export default async function ClientDashboardPage({ params, searchParams, }: ClientDashboardPageProps) { const { id } = await params; const { tab } = await searchParams; // Fetch client data let client; try { client = await getClient(id); } catch (error) { notFound(); } if (!client) { notFound(); } const clientWithAge = transformClient(client); return (
{/* Header */}
{/* Breadcrumb */} Terug naar cliënten {/* Client Info */}
{/* Avatar */}
{client.first_name[0]} {client.last_name[0]}
{/* Name & Info */}

{clientWithAge.full_name}

{clientWithAge.age} jaar Geboren:{' '} {new Date(client.birth_date).toLocaleDateString('nl-NL')}
{/* Actions */}
Bewerken
{/* Tab Content */}
); }