import { Redirect } from "expo-router";
import { useAccounts } from "@/contexts/AccountsContext";

export default function AuthIndex() {
  const { accounts, activeAccountId } = useAccounts();

  if (!activeAccountId && accounts.length > 0) {
    return <Redirect href="/(auth)/select-account" />;
  }

  return <Redirect href="/(auth)/sign-in" />;
}
