import { useState } from 'react'; import { Link, useLocation } from 'react-router-dom'; import { api } from '../api'; const navItems = [ { path: '/', label: 'Dashboard' }, { path: '/inventory', label: 'Inventory' }, { path: '/customers', label: 'Customers' }, { path: '/orders', label: 'Orders' }, ]; export default function Layout({ children, onLogout }) { const [menuOpen, setMenuOpen] = useState(false); const location = useLocation(); async function handleLogout() { await api('/auth/logout', { method: 'POST' }); onLogout?.(); } return (
Cookie Tracker
{children}
); }