import { useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
import SignInModal from '@/components/frameworks/SignInModal';
import { useAuth } from '@/contexts/useAuth';

const Login = () => {
  const { isAuthenticated } = useAuth();
  const navigate = useNavigate();

  useEffect(() => {
    if (isAuthenticated) {
      navigate('/', { replace: true });
    }
  }, [isAuthenticated, navigate]);

  return (
    <div className="min-h-screen bg-gradient-to-br from-slate-950 via-slate-900 to-slate-950">
      <SignInModal isOpen onClose={() => navigate('/', { replace: true })} />
    </div>
  );
};

export default Login;
