feat(report): PractitionerForm with required name + optional fields
This commit is contained in:
1 parent
3ef1c60682
commit
2970e7fcf5
1 file changed
+32
-2
@@ -1,3 +1,33 @@
|
|||||||
export default function PractitionerForm() {
|
import type { Practitioner } from '@/domain/schema/practitioner'
|
||||||
return <div>PractitionerForm placeholder</div>
|
import Label from '@/components/ui/Label'
|
||||||
|
import Input from '@/components/ui/Input'
|
||||||
|
|
||||||
|
export interface PractitionerFormProps {
|
||||||
|
value: Practitioner
|
||||||
|
onChange: (next: Practitioner) => void
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function PractitionerForm({ value, onChange }: PractitionerFormProps) {
|
||||||
|
const set = (patch: Partial<Practitioner>) => onChange({ ...value, ...patch })
|
||||||
|
return (
|
||||||
|
<fieldset className="space-y-3">
|
||||||
|
<legend className="font-serif text-xl mb-2 text-[var(--color-ink)]">Praticien</legend>
|
||||||
|
<div>
|
||||||
|
<Label htmlFor="prac-name">Nom complet *</Label>
|
||||||
|
<Input id="prac-name" required value={value.name} onChange={(e) => set({ name: e.target.value })} />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Label htmlFor="prac-cabinet">Cabinet / clinique</Label>
|
||||||
|
<Input id="prac-cabinet" value={value.cabinet ?? ''} onChange={(e) => set({ cabinet: e.target.value || undefined })} />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Label htmlFor="prac-contact">Contact (téléphone, email…)</Label>
|
||||||
|
<Input id="prac-contact" value={value.contact ?? ''} onChange={(e) => set({ contact: e.target.value || undefined })} />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Label htmlFor="prac-siret">SIRET</Label>
|
||||||
|
<Input id="prac-siret" value={value.siret ?? ''} onChange={(e) => set({ siret: e.target.value || undefined })} />
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user