"use client"; import { useState } from "react"; import { useRouter } from "next/navigation"; export default function LoginPage() { const [email, setEmail] = useState(""); const [loading, setLoading] = useState(false); const router = useRouter(); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setLoading(true); try { const res = await fetch("/api/auth/signin", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ email }), }); if (res.ok) { router.push("/"); } } catch (err) { console.error(err); } setLoading(false); }; return (

Tia

Your baby tracking companion

setEmail(e.target.value)} className="w-full p-4 border rounded-2xl bg-white shadow-sm" required />
); }