import { useState } from "react"; import type { WidgetProps } from "./types"; export function FreetextWidget({ descriptor, onRespond }: WidgetProps) { const [text, setText] = useState(""); function submit() { if (text.trim()) onRespond({ id: descriptor.id, kind: "freetext", text }); } return (
{descriptor.title && (

{descriptor.title}

)}