e7a1290246
Next.js 16 + Auth.js v5 skeleton: host→slug middleware, tenant-context layout, OIDC sign-in flow against breakpilot-dev realm. 100% coverage on src/lib. Bumps next to 16.2.6 to clear trivy CVEs in 15.0.3.
37 lines
912 B
TypeScript
37 lines
912 B
TypeScript
import { notFound } from "next/navigation";
|
|
import type { ReactNode } from "react";
|
|
import { fetchTenantBySlug } from "@/lib/tenant-registry";
|
|
|
|
export default async function TenantLayout({
|
|
children,
|
|
params,
|
|
}: {
|
|
children: ReactNode;
|
|
params: Promise<{ slug: string }>;
|
|
}) {
|
|
const { slug } = await params;
|
|
const tenant = await fetchTenantBySlug(slug);
|
|
if (!tenant) notFound();
|
|
|
|
return (
|
|
<div>
|
|
<header
|
|
style={{
|
|
padding: "12px 24px",
|
|
borderBottom: "1px solid #eaeaea",
|
|
background: "white",
|
|
display: "flex",
|
|
alignItems: "center",
|
|
justifyContent: "space-between",
|
|
}}
|
|
>
|
|
<strong>{tenant.name}</strong>
|
|
<span style={{ fontSize: 12, color: "#666" }}>
|
|
{tenant.plan} · {tenant.status}
|
|
</span>
|
|
</header>
|
|
<main style={{ padding: 24 }}>{children}</main>
|
|
</div>
|
|
);
|
|
}
|