import { ReactNode, useState } from 'react'; import { NavLink, useNavigate } from 'react-router-dom'; import { useAuth } from '../lib/auth-context'; import { Button } from './ui'; /** * Global Navigation Shell (Section 2.0): persistent sidebar with Logo, * Dashboard, New Campaign, Campaign History, Account/License, Logout. * Collapses to a slide-in drawer under 768px (Section 7.3). */ export function AppShell({ children }: { children: ReactNode }) { const { logout } = useAuth(); const navigate = useNavigate(); const [open, setOpen] = useState(false); const links = [ { to: '/', label: 'Dashboard', icon: '📊' }, { to: '/campaigns/new', label: 'New Campaign', icon: '✨' }, { to: '/history', label: 'Campaign History', icon: '🗂️' }, { to: '/account', label: 'Account / License', icon: '🔑' }, ]; const doLogout = async () => { await logout(); navigate('/login'); }; const close = () => setOpen(false); return (