import { Button } from '@headlessui/react'; import { useState } from 'react'; import FormField from '../../../components/ui/forms/FormField'; import SubmitButton from '../../../components/ui/forms/SubmitButton'; import type { RegisterWizard } from '../hooks/useRegisterWizard'; import { minimumAgeYears } from '../schemas'; import ShowPasswordToggle from './ShowPasswordToggle'; interface RegisterFormProps { wizard: RegisterWizard; submitting: boolean; } const RegisterForm = ({ wizard, submitting }: RegisterFormProps) => { const [showPassword, setShowPassword] = useState(false); const { step, isLastStep, canGoBack, register, formState } = wizard; const { errors } = formState; return (
{step === 1 && (
)} {step === 2 && (
)} {step === 3 && (
setShowPassword((shown) => !shown)} />
)}
{canGoBack && ( )}
); }; export default RegisterForm;