feat(frontend): F1 widgets (select/info/freetext) + reserved controls

This commit is contained in:
2026-06-28 12:25:50 +02:00
parent e9aca179d7
commit a267754f8f
7 changed files with 76 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
import { useState } from "react";
import type { WidgetProps } from "./types";
export function FreetextWidget({ descriptor, onRespond }: WidgetProps) {
const [text, setText] = useState("");
return (
<div className="space-y-2">
{descriptor.title && <p className="font-medium">{descriptor.title}</p>}
<textarea className="w-full border rounded p-2" value={text} onChange={(e) => setText(e.target.value)} />
<button className="border rounded px-3 py-1" onClick={() => onRespond({ id: descriptor.id, kind: "freetext", text })}>Invia</button>
</div>
);
}