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

Welcome back

Sign in to your charity dashboard

{error && (
{error}
)}
setEmail(e.target.value)} className="mt-1 w-full rounded-xl border border-gray-200 px-4 py-3 text-sm focus:border-trust-blue focus:ring-2 focus:ring-trust-blue/20 outline-none transition-all" placeholder="you@charity.org" required />
setPassword(e.target.value)} className="mt-1 w-full rounded-xl border border-gray-200 px-4 py-3 text-sm focus:border-trust-blue focus:ring-2 focus:ring-trust-blue/20 outline-none transition-all" placeholder="••••••••" required />

Don't have an account?{" "} Get Started Free

) }