import { useSession } from "@/ctx";
import { Redirect } from "expo-router";
import Loading from "./loading";

export default function Index() {
  const { session, isLoading } = useSession();

  if (isLoading) return <Loading />;

  if (session) {
    return <Redirect href="/(tabs)/(home)/HomeScreen" />;
  }

  return <Redirect href="/log-in" />;
}
