34 lines
1.4 KiB
TypeScript
34 lines
1.4 KiB
TypeScript
import type { Practitioner } from '@/domain/schema/practitioner'
|
|
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>
|
|
)
|
|
}
|