Files
CubeAdmin/app/(dashboard)/layout.tsx
2026-03-08 15:49:34 +01:00

32 lines
995 B
TypeScript

import { Sidebar } from "@/components/layout/sidebar";
import { Topbar } from "@/components/layout/topbar";
// ---------------------------------------------------------------------------
// Dashboard Layout
// Renders the persistent sidebar + topbar shell around all dashboard pages.
// Auth protection is handled in middleware.ts.
// ---------------------------------------------------------------------------
export default function DashboardLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<div className="flex h-screen w-full overflow-hidden bg-zinc-950">
{/* Fixed sidebar */}
<Sidebar />
{/* Main content column */}
<div className="flex min-w-0 flex-1 flex-col overflow-hidden">
{/* Sticky topbar */}
<Topbar />
{/* Scrollable page content */}
<main className="flex-1 overflow-y-auto bg-zinc-950">
<div className="min-h-full p-6">{children}</div>
</main>
</div>
</div>
);
}