()
| 20 | type Page = "home" | "playground" | "routing" | "models" | "activity" | "budget" | "feedback" | "connections" | "explain" | "explain_new"; |
| 21 | |
| 22 | function AppShell() { |
| 23 | const [page, setPage] = useState<Page>("home"); |
| 24 | const { health, stats, mapping, spend, feedbackPending, ready, refresh } = useLiveData(); |
| 25 | |
| 26 | const upstream = health?.upstream?.replace(/^https?:\/\//, "").replace(/\/v1$/, "") ?? ""; |
| 27 | const isUp = health?.model_mapper?.discovered ?? false; |
| 28 | const version = health?.version ?? "—"; |
| 29 | |
| 30 | if (!ready) { |
| 31 | return ( |
| 32 | <div className="flex min-h-screen items-center justify-center bg-n-black"> |
| 33 | <div className="font-mono text-[11px] tracking-[0.1em] text-n-disabled animate-pulse"> |
| 34 | [CONNECTING...] |
| 35 | </div> |
| 36 | </div> |
| 37 | ); |
| 38 | } |
| 39 | |
| 40 | return ( |
| 41 | <div className="min-h-screen bg-n-black"> |
| 42 | <Sidebar |
| 43 | current={page} |
| 44 | onChange={(p) => setPage(p as Page)} |
| 45 | upstream={upstream} |
| 46 | isUp={isUp} |
| 47 | version={version} |
| 48 | feedbackPending={feedbackPending} |
| 49 | /> |
| 50 | |
| 51 | <main className="ml-[200px] min-h-screen"> |
| 52 | <div className="px-8 py-8 max-w-[1100px] mx-auto"> |
| 53 | {page === "home" && <Home stats={stats} />} |
| 54 | {page === "playground" && <Playground />} |
| 55 | {page === "explain" && <Explainer />} |
| 56 | {page === "explain_new" && <ExplainerNew />} |
| 57 | {page === "routing" && <Routing onRefresh={refresh} />} |
| 58 | {page === "activity" && <Activity stats={stats} />} |
| 59 | {page === "models" && <Models mapping={mapping} />} |
| 60 | {page === "connections" && <Connections initialConnection={health?.connections ?? null} onRefresh={refresh} />} |
| 61 | {page === "budget" && <SpendPanel spend={spend} onRefresh={refresh} />} |
| 62 | {page === "feedback" && <Feedback />} |
| 63 | </div> |
| 64 | </main> |
| 65 | </div> |
| 66 | ); |
| 67 | } |
| 68 | |
| 69 | export default function App() { |
| 70 | return ( |
nothing calls this directly
no test coverage detected