import { useEffect, useState } from 'react'; import { Outlet, NavLink } from 'react-router-dom'; import { api } from '../api/client'; const NAV = [ { to: '/dashboard', label: 'Dashboard', icon: 'DB' }, { to: '/map', label: 'Map View', icon: 'MP' }, { to: '/alerts', label: 'Live Shocks', icon: 'LS' }, { to: '/query', label: 'Ask ShockMap', icon: 'AI' }, { to: '/drugs', label: 'Inputs', icon: 'IN' }, { to: '/graph', label: 'Graph', icon: 'GR' }, { to: '/simulate', label: 'Simulate', icon: 'SM' }, ]; export default function AppShell({ children, selectedSectors }) { const [health, setHealth] = useState(null); useEffect(() => { api.health().then(setHealth).catch(() => setHealth(null)); }, []); const isHybridFeed = health?.shock_feed_mode === 'hybrid_demo_live'; const isDemoOnly = health?.shock_feed_mode === 'demo'; const feedText = isHybridFeed ? `Hybrid feed | ${health?.live_shocks || 0} live + ${health?.demo_scenarios || 0} scenarios` : isDemoOnly ? `Curated scenarios | ${health?.demo_scenarios || 0} loaded` : 'GDELT live | 15 min'; return (
{children || }
); }