Files
plane/space/app/page.tsx

22 lines
535 B
TypeScript
Raw Normal View History

2024-05-16 04:03:43 +05:30
"use client";
import { observer } from "mobx-react";
// components
import { UserLoggedIn } from "@/components/account";
2024-05-16 04:03:43 +05:30
import { LogoSpinner } from "@/components/common";
import { AuthView } from "@/components/views";
2024-05-16 04:03:43 +05:30
// hooks
import { useUser } from "@/hooks/store";
const HomePage = observer(() => {
2024-05-18 16:22:53 +05:30
const { data: currentUser, isAuthenticated, isLoading } = useUser();
if (isLoading) return <LogoSpinner />;
2024-05-16 04:03:43 +05:30
if (currentUser && isAuthenticated) return <UserLoggedIn />;
2024-05-15 02:25:38 +05:30
return <AuthView />;
});
export default HomePage;