plane/space/app/page.tsx

22 lines
540 B
TypeScript
Raw Normal View History

2024-05-15 22:33:43 +00:00
"use client";
import { observer } from "mobx-react-lite";
// 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";
const HomePage = observer(() => {
2024-05-18 10:52:53 +00:00
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 />;
});
export default HomePage;