app-shell.tsx 748 B

1234567891011121314151617181920212223
  1. "use client";
  2. import { useState, type ReactNode } from "react";
  3. import { Sidebar } from "@/components/layout/sidebar";
  4. import { TopBar } from "@/components/layout/top-bar";
  5. export function AppShell({ children }: { children: ReactNode }) {
  6. const [sidebarOpen, setSidebarOpen] = useState(false);
  7. return (
  8. <div className="min-h-dvh bg-background text-foreground">
  9. <Sidebar open={sidebarOpen} onClose={() => setSidebarOpen(false)} />
  10. <div className="flex min-h-dvh flex-col lg:pl-64">
  11. <TopBar onMenuClick={() => setSidebarOpen(true)} />
  12. <main className="flex-1 px-4 py-5 pb-[max(1.25rem,env(safe-area-inset-bottom))] sm:py-7 lg:px-8 lg:py-8">
  13. {children}
  14. </main>
  15. </div>
  16. </div>
  17. );
  18. }