import { useEffect, useState } from "react"; import { fetchMe, logout, type SessionUser } from "./api.js"; import { Login } from "./Login.js"; import { PermitManager } from "./PermitManager.js"; import { SetupWizard } from "./SetupWizard.js"; import { ShiftControl } from "./ShiftControl.js"; import { SiteSettings } from "./SiteSettings.js"; import { TariffComposer } from "./TariffComposer.js"; // Operator UI shell. Plain React (no admin framework) — the operator UI is // simple enough that a framework's abstractions cost more than they save. // Auth is cookie-based; the SPA bootstraps the session from /api/auth/me. // See wiki/entities/react-vite-spa.md and local-jwt-auth.md. export function App() { const [user, setUser] = useState(null); const [loading, setLoading] = useState(true); useEffect(() => { fetchMe() .then(setUser) .finally(() => setLoading(false)); }, []); if (loading) return

Loading…

; if (!user) return ; return (

Parking System

{user.username} ({user.role}){" "}
{user.role !== "readonly" && } {user.role === "admin" ? ( <> ) : (

Signed in. (Operator console coming soon.)

)}
); }