Skip to content
File

Blob: src/client/components/index-gateway.tsx

typescript23 lines
1import { useAuthStore, selectHasLocalSession } from "@/client/stores/auth-store";
2import { LandingPage } from "./landing-page";
3import { EmptyWorkspaceView } from "./empty-workspace-view";
4 
5export function IndexGateway() {
6 const hasLocalSession = useAuthStore(selectHasLocalSession);
7 const refreshState = useAuthStore((s) => s.refreshState);
8 
9 if (!hasLocalSession && refreshState === "refreshing") {
10 return (
11 <div className="flex min-h-screen items-center justify-center" aria-busy="true">
12 <div className="animate-slide-up text-center">
13 <div className="mx-auto mb-3 h-1.5 w-1.5 animate-pulse rounded-full bg-zinc-400" aria-hidden="true" />
14 <p className="text-sm text-zinc-400">Restoring your session.</p>
15 </div>
16 </div>
17 );
18 }
19 
20 if (!hasLocalSession) return <LandingPage />;
21 return <EmptyWorkspaceView />;
22}