import { Form } from '@inertiajs/react'; import { useState } from 'react'; import { Button } from '@/components/site/button'; import { Field, FieldError, FormSuccess, Honeypot, SelectInput, TextInput, } from '@/components/site/form-field'; import { common, serviceOptions } from '@/content/common'; import { useContent } from '@/hooks/use-locale'; import { store } from '@/routes/consultations'; type ConsultationFormProps = { idPrefix: string; /** Which page the request came from, shown in the admin inbox. */ source: 'home' | 'services'; }; /** Compact consultation request form, saved to the admin inbox. */ export default function ConsultationForm({ idPrefix, source, }: ConsultationFormProps) { const t = useContent(common); const [submitted, setSubmitted] = useState(false); return (
{t.form.title} {t.form.subtitle}
{submitted ? ( ) : (
setSubmitted(true)} className="relative flex flex-col gap-3" > {({ processing, errors }) => ( <>

{t.form.nda}

)} )}
); }