plane/space/app/page.tsx

19 lines
471 B
TypeScript
Raw Normal View History

2024-05-15 22:33:43 +00:00
"use client";
// components
import { UserLoggedIn } from "@/components/account";
2024-05-15 22:33:43 +00:00
import { LogoSpinner } from "@/components/common";
import { AuthView } from "@/components/views";
2024-05-15 22:33:43 +00:00
// hooks
import { useUser } from "@/hooks/store";
2024-05-18 10:52:53 +00:00
export default function HomePage() {
const { data: currentUser, isAuthenticated, isLoading } = useUser();
if (isLoading) return <LogoSpinner />;
2024-05-15 22:33:43 +00:00
if (currentUser && isAuthenticated) return <UserLoggedIn />;
2024-05-14 20:55:38 +00:00
return <AuthView />;
}