"use client"; import { useState } from 'react' import { Button, Description, Dialog, DialogPanel, Field, Input, Label } from '@headlessui/react' import { Bars3Icon, CheckCircleIcon, Square2StackIcon, XCircleIcon, XMarkIcon } from '@heroicons/react/24/outline' import Logo from './logo'; import Form, { FieldType } from './form'; import { Question } from '../lib/question'; const FormQuestion = ({question}: {question: Question}) => { const [formData, setFormData] = useState(); // const formSubmit = (e) => { // e.preventDefault(); // setFormData( new FormData( e.target ) ); // } const formSubmit = (data: FormData) => setFormData( data ); return (

This does not work yet, and is work in progress

{question.text}
{/* {formData && JSON.stringify(Object.fromEntries(formData.entries()))} */} {/* {JSON.stringify(formData)} */}

{/*
Type your answer here:
*/ }
) } export default FormQuestion;