import { Outlet, useLocation } from 'react-router-dom'; import { useState, useEffect } from 'react'; import { Menu } from 'lucide-react'; import Sidebar from './Sidebar'; export default function Layout() { const [mobileOpen, setMobileOpen] = useState(false); const location = useLocation(); // Close drawer whenever the route changes. useEffect(() => { setMobileOpen(false); }, [location.pathname]); return (
{/* Floating hamburger (mobile only, no full topbar) */} {/* Backdrop for mobile drawer */} {mobileOpen && (
setMobileOpen(false)} aria-hidden="true" /> )} setMobileOpen(false)} />
); }