2026-07-17 18:33:06 +02:00
|
|
|
|
import { useState } from "react";
|
|
|
|
|
|
import "./App.css";
|
|
|
|
|
|
import { GarminConnection } from "./components/GarminConnection";
|
2026-07-19 11:11:50 +02:00
|
|
|
|
import { Activities } from "./pages/Activities";
|
2026-07-17 18:33:06 +02:00
|
|
|
|
import { Dashboard } from "./pages/Dashboard";
|
2026-07-17 19:22:25 +02:00
|
|
|
|
import { Profile } from "./pages/Profile";
|
2026-07-17 18:33:06 +02:00
|
|
|
|
import { ReviewQueue } from "./pages/ReviewQueue";
|
|
|
|
|
|
import { WorkoutKinds } from "./pages/WorkoutKinds";
|
|
|
|
|
|
|
|
|
|
|
|
const TABS = [
|
|
|
|
|
|
{ key: "dashboard", label: "Progression", Component: Dashboard },
|
|
|
|
|
|
{ key: "review", label: "Review Queue", Component: ReviewQueue },
|
2026-07-19 11:11:50 +02:00
|
|
|
|
{ key: "activities", label: "Activities", Component: Activities },
|
2026-07-17 18:33:06 +02:00
|
|
|
|
{ key: "kinds", label: "Workout Kinds", Component: WorkoutKinds },
|
2026-07-17 19:22:25 +02:00
|
|
|
|
{ key: "profile", label: "Profile", Component: Profile },
|
2026-07-17 18:33:06 +02:00
|
|
|
|
] as const;
|
|
|
|
|
|
|
|
|
|
|
|
type TabKey = (typeof TABS)[number]["key"];
|
|
|
|
|
|
|
|
|
|
|
|
function App() {
|
|
|
|
|
|
const [tab, setTab] = useState<TabKey>("dashboard");
|
|
|
|
|
|
const Active = TABS.find((t) => t.key === tab)!.Component;
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
<div className="app">
|
|
|
|
|
|
<header className="app-header">
|
2026-07-19 16:05:41 +02:00
|
|
|
|
<h1>🧞♀️ geniusrun</h1>
|
2026-07-17 18:33:06 +02:00
|
|
|
|
<nav className="tabs">
|
|
|
|
|
|
{TABS.map((t) => (
|
|
|
|
|
|
<button
|
|
|
|
|
|
key={t.key}
|
|
|
|
|
|
className={t.key === tab ? "tab active" : "tab"}
|
|
|
|
|
|
onClick={() => setTab(t.key)}
|
|
|
|
|
|
>
|
|
|
|
|
|
{t.label}
|
|
|
|
|
|
</button>
|
|
|
|
|
|
))}
|
|
|
|
|
|
</nav>
|
|
|
|
|
|
</header>
|
|
|
|
|
|
<GarminConnection />
|
|
|
|
|
|
<main>
|
|
|
|
|
|
<Active />
|
|
|
|
|
|
</main>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export default App;
|