"use client"; import { useCallback, useState, type ReactNode } from "react"; import type { OpenNote } from "@/lib/notes"; import { Sidebar } from "./Sidebar"; import { Topbar } from "./Topbar"; // Owns the one piece of state the shell needs (is the mobile drawer open), // so app/(app)/layout.tsx can stay a Server Component and keep doing its // auth check and data loading on the server. export function AppShell({ userLabel, openNotes, children }: { userLabel: string; openNotes: OpenNote[]; children: ReactNode }) { const [navOpen, setNavOpen] = useState(false); const closeNav = useCallback(() => setNavOpen(false), []); return (
setNavOpen(true)} />
{children}
); }