"use client"; import { useState } from "react"; import { useRouter } from "next/navigation"; export default function OnboardingPage() { const router = useRouter(); const [step, setStep] = useState(1); const [loading, setLoading] = useState(false); const [form, setForm] = useState({ familyName: "", memberName: "", childName: "", birthDate: "", sex: "" as "male" | "female" | "other", }); const handleSubmit = async () => { setLoading(true); try { const res = await fetch("/api/onboarding", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(form), }); if (res.ok) { router.push("/"); } } catch (e) { console.error(e); } setLoading(false); }; return (
Let's set up your family