feat(01-03): add /c/[token] Server Component route + layout

- src/app/c/[token]/page.tsx: Server Component calls getClientView(), notFound() on null
- src/app/c/[token]/layout.tsx: layout with metadata for client portal
- [Rule 1 - Bug] Renamed middleware.ts → proxy.ts and export middleware → proxy
  (Next.js 16 deprecated 'middleware' file convention; requires 'proxy' export name)
- params typed as Promise<{ token: string }> per Next.js 15+ breaking change
- npm run build: SUCCESS (no TypeScript errors)
This commit is contained in:
Simone Cavalli
2026-05-14 21:11:32 +02:00
parent 14787bab10
commit 8b5e723f81
3 changed files with 43 additions and 1 deletions
+14
View File
@@ -0,0 +1,14 @@
import type { Metadata } from 'next';
export const metadata: Metadata = {
title: 'Client Portal',
description: 'Project status dashboard',
};
export default function ClientLayout({
children,
}: {
children: React.ReactNode;
}) {
return <>{children}</>;
}
+28
View File
@@ -0,0 +1,28 @@
import { getClientView } from '@/lib/client-view';
import { notFound } from 'next/navigation';
export const revalidate = 60; // ISR: revalidate every 60 seconds
export default async function ClientDashboard({
params,
}: {
params: Promise<{ token: string }>;
}) {
const { token } = await params;
const view = await getClientView(token);
if (!view) {
notFound();
}
return (
<div className="min-h-screen bg-white">
{/* Placeholder: Dashboard UI will be built in Plan 04 */}
<div className="p-6">
<h1 className="text-2xl font-bold">{view.client.brand_name}</h1>
<p className="text-gray-600">{view.client.brief}</p>
<p className="text-sm text-gray-400 mt-2">Token: {token}</p>
</div>
</div>
);
}