Files
archie/dashboard-v2/src/App.tsx
T

30 lines
803 B
TypeScript

import { Center } from "@astryxdesign/core/Center";
import { Text } from "@astryxdesign/core/Text";
import StatusPage from "./pages/StatusPage.tsx";
import LoginPage from "./pages/LoginPage.tsx";
import { useSession } from "./session.tsx";
export default function App() {
const { state } = useSession();
if (state === "unknown") {
return (
<Center axis="both" padding={6}>
<Text type="body">Loading…</Text>
</Center>
);
}
// Fresh installs set up through the Vue dashboard until v2 grows a
// setup page.
if (state === "setup") {
return (
<Center axis="both" padding={6}>
<Text type="body">Complete initial setup before signing in.</Text>
</Center>
);
}
if (state === "guest") return <LoginPage />;
return <StatusPage />;
}