// Main App — routes between pages, owns tweaks. const { useState: usS, useEffect: usE, useMemo: usM } = React; const ACCENT_SOFT = { "#00D4AA": "rgba(0,212,170,0.12)", "#7C5CFF": "rgba(124,92,255,0.14)", "#3B82F6": "rgba(59,130,246,0.14)", "#F5A623": "rgba(245,166,35,0.14)", }; function App() { const [t, setT] = useTweaks(window.TWEAK_DEFAULTS); const [collapsed, setCollapsed] = usS(t.sidebarCollapsed); const [route, setRoute] = usS(() => location.hash.slice(1) || "dash"); usE(() => setCollapsed(t.sidebarCollapsed), [t.sidebarCollapsed]); usE(() => { const onHash = () => setRoute(location.hash.slice(1) || "dash"); window.addEventListener("hashchange", onHash); return () => window.removeEventListener("hashchange", onHash); }, []); const goto = (r) => { location.hash = r; setRoute(r); }; const setActiveExchange = (id) => setT("activeExchange", id); const accent = { base: t.accent, soft: ACCENT_SOFT[t.accent] || "rgba(0,212,170,0.12)" }; usE(() => { document.documentElement.style.setProperty("--accent", accent.base); document.documentElement.style.setProperty("--accent-soft", accent.soft); document.documentElement.dataset.density = t.density; }, [t.accent, t.density]); // Auto-bump mode to paper when switching to Kraken (no public testnet) usE(() => { if (t.activeExchange === "kraken" && t.mode === "testnet") setT("mode", "paper"); if (t.activeExchange === "binance" && t.mode === "paper") setT("mode", "testnet"); }, [t.activeExchange]); return (