import { observer } from "mobx-react-lite"; import Image from "next/image"; // ui import { useTheme } from "next-themes"; import useSWR from "swr"; import { Spinner } from "@plane/ui"; // components import { AuthRoot, UserLoggedIn } from "@/components/accounts"; // hooks import { useUser } from "@/hooks/store"; // images import PlaneBackgroundPatternDark from "public/auth/background-pattern-dark.svg"; import PlaneBackgroundPattern from "public/auth/background-pattern.svg"; import BluePlaneLogoWithoutText from "public/plane-logos/blue-without-text-new.png"; export const AuthView = observer(() => { // hooks const { resolvedTheme } = useTheme(); // store const { data: currentUser, fetchCurrentUser, isLoading } = useUser(); // fetching user information useSWR("CURRENT_USER_DETAILS", () => fetchCurrentUser(), { shouldRetryOnError: false, revalidateOnFocus: false, }); return ( <> {isLoading ? (
) : ( <> {currentUser ? ( ) : (
Plane background pattern
Plane Logo Plane
)} )} ); });