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 ClientDetailPageProps { params: Promise<{ id: string }>; searchParams: Promise<{ tab?: string }>; } export default async function ClientDetailPage({ params, searchParams, }: ClientDetailPageProps) { 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 */}
); }