diff --git a/src/app/c/[token]/layout.tsx b/src/app/c/[token]/layout.tsx new file mode 100644 index 0000000..5a10360 --- /dev/null +++ b/src/app/c/[token]/layout.tsx @@ -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}; +} \ No newline at end of file diff --git a/src/app/c/[token]/page.tsx b/src/app/c/[token]/page.tsx new file mode 100644 index 0000000..06c9738 --- /dev/null +++ b/src/app/c/[token]/page.tsx @@ -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 ( +
+ {/* Placeholder: Dashboard UI will be built in Plan 04 */} +
+

{view.client.brand_name}

+

{view.client.brief}

+

Token: {token}

+
+
+ ); +} \ No newline at end of file diff --git a/src/middleware.ts b/src/proxy.ts similarity index 94% rename from src/middleware.ts rename to src/proxy.ts index 9ab66ae..13bb305 100644 --- a/src/middleware.ts +++ b/src/proxy.ts @@ -1,6 +1,6 @@ import { NextRequest, NextResponse } from 'next/server'; -export async function middleware(request: NextRequest) { +export async function proxy(request: NextRequest) { const pathname = request.nextUrl.pathname; // Extract token from path: /c/[token]/...