"use client"; import { signIn } from "next-auth/react"; import { useState } from "react"; import { useRouter } from "next/navigation"; export default function LoginPage() { const router = useRouter(); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [error, setError] = useState(""); const [loading, setLoading] = useState(false); const handleCredentialsLogin = async (e: React.FormEvent) => { e.preventDefault(); setLoading(true); setError(""); const result = await signIn("credentials", { email, password, redirect: false, }); setLoading(false); if (result?.error) { setError("Invalid email or password"); } else { router.push("/"); router.refresh(); } }; const handleSocialLogin = (provider: "google" | "facebook") => { signIn(provider, { callbackUrl: "/" }); }; return (

Real Estate Platform

Sign in to your account

{/* SSO Buttons */}
Or continue with email
{/* Email/Password Form */}
{error && (
{error}
)}
setEmail(e.target.value)} className="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500" />
setPassword(e.target.value)} className="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500" />
Forgot your password?

Don't have an account?{" "} Sign up

); }