Lift AppSidebar, SidebarInset and SidebarTrigger into the root layout so page.tsx only contains page-specific content. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
56 lines
1.5 KiB
TypeScript
56 lines
1.5 KiB
TypeScript
import type { Metadata } from "next";
|
|
import { Geist, Geist_Mono, Inter } from "next/font/google";
|
|
import "@multica/ui/globals.css";
|
|
import { SidebarProvider, SidebarInset, SidebarTrigger } from "@multica/ui/components/ui/sidebar";
|
|
import { AppSidebar } from "@multica/ui/components/app-sidebar";
|
|
|
|
const inter = Inter({subsets:['latin'],variable:'--font-sans'});
|
|
|
|
const geistSans = Geist({
|
|
variable: "--font-geist-sans",
|
|
subsets: ["latin"],
|
|
});
|
|
|
|
const geistMono = Geist_Mono({
|
|
variable: "--font-geist-mono",
|
|
subsets: ["latin"],
|
|
});
|
|
|
|
export const metadata: Metadata = {
|
|
title: "Create Next App",
|
|
description: "Generated by create next app",
|
|
};
|
|
|
|
const NAV_ITEMS = [
|
|
{ title: "Home", url: "#" },
|
|
{ title: "Documents", url: "#" },
|
|
{ title: "Settings", url: "#" },
|
|
];
|
|
|
|
export default function RootLayout({
|
|
children,
|
|
}: Readonly<{
|
|
children: React.ReactNode;
|
|
}>) {
|
|
return (
|
|
<html lang="en" className={inter.variable}>
|
|
<body
|
|
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
|
|
>
|
|
<SidebarProvider>
|
|
<AppSidebar items={NAV_ITEMS} />
|
|
<SidebarInset>
|
|
<div className="flex h-dvh overflow-hidden">
|
|
<header className="flex items-center p-2">
|
|
<SidebarTrigger />
|
|
</header>
|
|
<div className="flex-1">
|
|
{children}
|
|
</div>
|
|
</div>
|
|
</SidebarInset>
|
|
</SidebarProvider>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|