ForFarm/frontend/app/layout.tsx
2025-02-12 19:07:42 +07:00

53 lines
1.3 KiB
TypeScript

import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import "./globals.css";
import { SidebarProvider, SidebarTrigger } from "@/components/ui/sidebar";
import { AppSidebar } from "@/components/app-sidebar";
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",
};
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased`}
>
{/* Sidebar Provider wraps the entire app */}
<SidebarProvider>
<div className="flex">
{/* Sidebar Component */}
<AppSidebar />
<div className="flex-1">
{/* Sidebar Toggle Button (Place in Navbar or Sidebar) */}
<SidebarTrigger className="m-4 p-2 bg-gray-300 rounded">
Open Sidebar
</SidebarTrigger>
{/* Main Content */}
<main className="p-4">{children}</main>
</div>
</div>
</SidebarProvider>
</body>
</html>
);
}