2026-09-23 16:39:36 -04:00
|
|
|
import { useState } from "react";
|
|
|
|
|
import "./App.css";
|
2026-09-23 20:13:52 -04:00
|
|
|
import TodayTab from "./today/TodayTab";
|
2026-09-23 16:39:36 -04:00
|
|
|
|
|
|
|
|
const TABS = [
|
|
|
|
|
{ id: "today", label: "Today" },
|
|
|
|
|
{ id: "tasks", label: "Tasks" },
|
|
|
|
|
{ id: "schedule", label: "Schedule" },
|
|
|
|
|
{ id: "history", label: "History" },
|
|
|
|
|
] as const;
|
|
|
|
|
|
|
|
|
|
type TabId = (typeof TABS)[number]["id"];
|
|
|
|
|
|
|
|
|
|
export default function App() {
|
|
|
|
|
const [active, setActive] = useState<TabId>("today");
|
2026-09-23 20:13:52 -04:00
|
|
|
// Built screens own their header (ADMIN-SPEC §1); the generic shell header
|
|
|
|
|
// stays for placeholder tabs and is visually hidden otherwise.
|
|
|
|
|
const hasScreen = active === "today";
|
2026-09-23 16:39:36 -04:00
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="admin-shell">
|
2026-09-23 20:13:52 -04:00
|
|
|
<header className={hasScreen ? "admin-header visually-hidden" : "admin-header"}>
|
2026-09-23 16:39:36 -04:00
|
|
|
<h1 className="admin-title">NestQuest Admin</h1>
|
|
|
|
|
<p className="admin-subline">Admin console</p>
|
|
|
|
|
</header>
|
|
|
|
|
<main
|
2026-09-23 20:13:52 -04:00
|
|
|
className={hasScreen ? "admin-panel admin-panel--screen" : "admin-panel"}
|
2026-09-23 16:39:36 -04:00
|
|
|
role="tabpanel"
|
|
|
|
|
aria-labelledby={`tab-${active}`}
|
|
|
|
|
>
|
2026-09-23 20:13:52 -04:00
|
|
|
{active === "today" ? (
|
|
|
|
|
<TodayTab />
|
|
|
|
|
) : (
|
|
|
|
|
<p className="admin-placeholder">
|
|
|
|
|
{TABS.find((tab) => tab.id === active)?.label} placeholder — screens
|
|
|
|
|
arrive in later tasks.
|
|
|
|
|
</p>
|
|
|
|
|
)}
|
2026-09-23 16:39:36 -04:00
|
|
|
</main>
|
|
|
|
|
<nav className="admin-tabbar" aria-label="Admin sections">
|
|
|
|
|
{TABS.map((tab) => (
|
|
|
|
|
<button
|
|
|
|
|
key={tab.id}
|
|
|
|
|
id={`tab-${tab.id}`}
|
|
|
|
|
type="button"
|
|
|
|
|
role="tab"
|
|
|
|
|
aria-selected={tab.id === active}
|
|
|
|
|
className={tab.id === active ? "admin-tab active" : "admin-tab"}
|
|
|
|
|
onClick={() => setActive(tab.id)}
|
|
|
|
|
>
|
|
|
|
|
{tab.label}
|
|
|
|
|
</button>
|
|
|
|
|
))}
|
|
|
|
|
</nav>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|