58 lines
1.7 KiB
TypeScript
58 lines
1.7 KiB
TypeScript
import type { Practitioner } from '@faunosteo/domain'
|
|
import Label from '@/components/ui/Label'
|
|
import Input from '@/components/ui/Input'
|
|
import { useT } from '@/i18n/useT'
|
|
|
|
export interface PractitionerFormProps {
|
|
value: Practitioner
|
|
onChange: (next: Practitioner) => void
|
|
}
|
|
|
|
export default function PractitionerForm({
|
|
value,
|
|
onChange,
|
|
}: PractitionerFormProps) {
|
|
const t = useT()
|
|
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)]">
|
|
{t('form.practitioner.legend')}
|
|
</legend>
|
|
<div>
|
|
<Label htmlFor="prac-name">{t('form.practitioner.name')}</Label>
|
|
<Input
|
|
id="prac-name"
|
|
required
|
|
value={value.name}
|
|
onChange={(e) => set({ name: e.target.value })}
|
|
/>
|
|
</div>
|
|
<div>
|
|
<Label htmlFor="prac-cabinet">{t('form.practitioner.cabinet')}</Label>
|
|
<Input
|
|
id="prac-cabinet"
|
|
value={value.cabinet ?? ''}
|
|
onChange={(e) => set({ cabinet: e.target.value || undefined })}
|
|
/>
|
|
</div>
|
|
<div>
|
|
<Label htmlFor="prac-contact">{t('form.practitioner.contact')}</Label>
|
|
<Input
|
|
id="prac-contact"
|
|
value={value.contact ?? ''}
|
|
onChange={(e) => set({ contact: e.target.value || undefined })}
|
|
/>
|
|
</div>
|
|
<div>
|
|
<Label htmlFor="prac-siret">{t('form.practitioner.siret')}</Label>
|
|
<Input
|
|
id="prac-siret"
|
|
value={value.siret ?? ''}
|
|
onChange={(e) => set({ siret: e.target.value || undefined })}
|
|
/>
|
|
</div>
|
|
</fieldset>
|
|
)
|
|
}
|