'use client'; import { useTranslations } from 'next-intl'; import { useState, type FormEvent } from 'react'; import { Button } from '@/components/ui/button'; import { acceptDisclaimer } from './actions'; export function DisclaimerForm() { const t = useTranslations('Welcome'); const [adult, setAdult] = useState(false); const [aware, setAware] = useState(false); const [accepts, setAccepts] = useState(false); const [pending, setPending] = useState(false); const allChecked = adult && aware && accepts; async function handleSubmit(event: FormEvent) { event.preventDefault(); if (!allChecked) return; setPending(true); await acceptDisclaimer(); } return (
); } function Checkbox({ checked, onChange, label, }: { checked: boolean; onChange: (next: boolean) => void; label: string; }) { return ( ); }