import { useEffect, useState } from "react"; import { api, BASE_URL } from "./api/client"; import "./App.css"; import { Dashboard } from "./pages/Dashboard"; import { Plan } from "./pages/Plan"; import { Profile } from "./pages/Profile"; import { ReviewQueue } from "./pages/ReviewQueue"; import type { SessionInfo } from "./types/api"; const TABS = [ { key: "activities", label: "Activities", icon: "☰", Component: ReviewQueue }, { key: "dashboard", label: "Progression", icon: "↗", Component: Dashboard }, { key: "plan", label: "Training plan", icon: "✎", Component: Plan }, ] as const; type TabKey = (typeof TABS)[number]["key"]; function App({ session }: { session: SessionInfo }) { const [tab, setTab] = useState("activities"); // Profile isn't a tab: it's reached via the profile name in the top-right // corner instead, since (for now, single-profile) it's account settings, // not a content view alongside Activities/Progression/Training plan. const [showProfile, setShowProfile] = useState(false); const [profileName, setProfileName] = useState(null); useEffect(() => { api.getProfile().then((p) => setProfileName(p.Name)).catch(() => {}); }, []); const Active = TABS.find((t) => t.key === tab)!.Component; return (

🧞‍♀️ geniusrun

{showProfile ? setProfileName(p.Name)} /> : }
); } export default App;