import { useState } from 'react';
export default function ProsthesisForm({ customerUuid, limbs, onSave, onCancel }) { const [f,setF]=useState({customer_uuid:customerUuid,limb_profile_uuid:limbs[0]?.uuid||'',data_label:'WORKSHOP RECORD'}); const field=(k,l)=><label className="text-sm text-slate-300">{l}<input className="workshop-input" value={f[k]||''} onChange={e=>setF({...f,[k]:e.target.value})}/></label>; return <form className="grid gap-4 md:grid-cols-2" onSubmit={e=>{e.preventDefault();onSave(f)}}><label className="text-sm text-slate-300">Limb profile<select className="workshop-input" value={f.limb_profile_uuid} onChange={e=>setF({...f,limb_profile_uuid:e.target.value})}>{limbs.map(x=><option key={x.uuid} value={x.uuid}>{x.profile_name}</option>)}</select></label>{field('name','Prosthesis name')}{field('configuration','Configuration')}{field('manufacturer','Manufacturer')}{field('model','Model')}{field('serial_number','Serial number (optional)')}{field('notes','Notes')}<div className="flex gap-2 md:col-span-2"><button className="btn-primary">Save prosthesis</button><button type="button" className="btn-secondary" onClick={onCancel}>Cancel</button></div></form> }