bee688e574
- app.md - auth.go - chat.go - chat.log - db.go - frontend/package.json - frontend/pnpm-lock.yaml - frontend/src/App.tsx - frontend/src/Root.tsx - frontend/src/api.ts - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
18 lines
405 B
TypeScript
18 lines
405 B
TypeScript
import { Center, Loader } from "@mantine/core";
|
|
import { App } from "./App";
|
|
import { useAuth } from "./auth";
|
|
import { LoginPage } from "./components/LoginPage";
|
|
|
|
export function Root() {
|
|
const { user, loading } = useAuth();
|
|
if (loading) {
|
|
return (
|
|
<Center style={{ minHeight: "100vh" }}>
|
|
<Loader />
|
|
</Center>
|
|
);
|
|
}
|
|
if (!user) return <LoginPage />;
|
|
return <App />;
|
|
}
|