import { useState, useEffect } from 'react'; import { NavLink } from 'react-router-dom'; import { LayoutGrid, Trophy, FlaskConical, ScanLine, LineChart, ParkingSquare, PanelLeftClose, } from 'lucide-react'; const NAV = [ { to: '/', icon: LayoutGrid, label: 'Overview', end: true }, { to: '/leaderboard', icon: Trophy, label: 'Leaderboard' }, { to: '/experiments', icon: FlaskConical, label: 'Strategies' }, { to: '/backtest', icon: ScanLine, label: 'Backtest' }, { to: '/paper', icon: LineChart, label: 'Paper Trading' }, ]; const DOCS_NAV = [ { to: '/docs/cash-parking', icon: ParkingSquare, label: 'Cash Parking' }, ]; const EXPANDED_W = 230; const COLLAPSED_W = 56; const STORAGE_KEY = 'sidebar-collapsed'; export function Sidebar() { const [collapsed, setCollapsed] = useState(() => { try { return localStorage.getItem(STORAGE_KEY) === '1'; } catch { return false; } }); const width = collapsed ? COLLAPSED_W : EXPANDED_W; useEffect(() => { document.documentElement.style.setProperty('--sidebar-w', `${width}px`); try { localStorage.setItem(STORAGE_KEY, collapsed ? '1' : '0'); } catch {} }, [collapsed, width]); const toggle = () => setCollapsed(c => !c); return ( ); }