"use client"; import React, { useState } from "react"; import axios from "axios"; export default function ForgotPasswordForm() { const [email, setEmail] = useState(""); const [loading, setLoading] = useState(false); const [message, setMessage] = useState(""); const handleForgot = async (e: React.FormEvent) => { e.preventDefault(); setLoading(true); setMessage(""); try { const res = await axios.post("http://localhost:3010/api/auth/forgot-password", { email }); setMessage("✅ We’ve emailed you a reset code / link. Enter it below."); } catch (err: any) { console.error(err); setMessage("Something went wrong. Try again."); } finally { setLoading(false); } }; return (
setEmail(e.target.value)} className="form-input w-full rounded-md border-white-light bg-transparent text-black dark:text-white" placeholder="you@example.com" />
{message &&

{message}

}
); }