+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';
-
-
- Client Dashboard
-
-
- Overzicht, recente activiteit, snelle acties
-
-
- Placeholder - Not designed yet
-
+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 */}
+
+
);
diff --git a/app/epd/clients/[id]/page.tsx b/app/epd/clients/[id]/page.tsx
index f0d8e5b..b922cc0 100644
--- a/app/epd/clients/[id]/page.tsx
+++ b/app/epd/clients/[id]/page.tsx
@@ -1,94 +1,18 @@
-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';
+import { redirect } from 'next/navigation';
interface ClientDetailPageProps {
params: Promise<{ id: string }>;
- searchParams: Promise<{ tab?: string }>;
}
+/**
+ * Redirect route: /epd/clients/[id] -> /epd/clients/[id]/dashboard
+ *
+ * Wanneer een gebruiker direct naar /epd/clients/[id] navigeert,
+ * wordt deze automatisch doorgestuurd naar het dashboard.
+ */
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 */}
-
-
-
-
- );
+ redirect(`/epd/clients/${id}/dashboard`);
}
diff --git a/app/epd/clients/components/client-list.tsx b/app/epd/clients/components/client-list.tsx
index 9deb275..68a95bc 100644
--- a/app/epd/clients/components/client-list.tsx
+++ b/app/epd/clients/components/client-list.tsx
@@ -124,7 +124,8 @@ export function ClientList({ initialClients }: ClientListProps) {
{filteredClients.map((client) => (
router.push(`/epd/clients/${client.id}`)}
+ className="hover:bg-slate-50 transition-colors cursor-pointer"
>
@@ -153,7 +154,10 @@ export function ClientList({ initialClients }: ClientListProps) {
{new Date(client.created_at).toLocaleDateString('nl-NL')}
-
+
e.stopPropagation()}
+ >