import { Redirect } from 'expo-router';

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

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

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

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