import { Redirect } from 'expo-router';

import { AuthForm } from '@/components/auth/AuthForm';
import { useAuth } from '@/providers/AuthProvider';

export default function LoginScreen() {
  const { initializing, user } = useAuth();

  if (!initializing && user) {
    return <Redirect href="/(tabs)" />;
  }

  return <AuthForm mode="login" />;
}
