geändert auf FormContext - **WOP**

This commit is contained in:
rxf
2025-10-26 20:33:29 +01:00
parent 63aa295562
commit e3af52a2a0
14 changed files with 1982 additions and 85 deletions

View File

@@ -0,0 +1,34 @@
import { useState } from 'react'
import { useFormData } from './FormContext.jsx'
export default function FandStattVer({left, right, onNext, isCompleted}) {
const { formData, updateFormData } = useFormData()
const [auswahl, setAuswahl] = useState(formData.stattgefunden || '')
const handleOK = () => {
if(!auswahl) {
alert('Bitte ja/nein wäölen')
return
}
updateFormData('stattgefunden', auswahl)
onNext(auswahl)
}
return (
<section>
<h3>Fand die Führung statt?</h3>
<div className="fstdiv">
<label className="fsLabel">
<input type="radio" name="fst" value={left} checked={auswahl === left}
onChange = {(e) => setAuswahl(e.target.value)} />
{left}
</label>
<label className="fsLabel">
<input type="radio" name="fst" value={right} checked={auswahl === right}
onChange = {(e) => setAuswahl(e.target.value)} />
{right}
</label>
<button className="okbutton" onClick={handleOK} disabled = {!auswahl}>OK</button>
</div>
</section>
)
}