diff --git a/src/components/report/AnimalForm.tsx b/src/components/report/AnimalForm.tsx index 462035c8..f2b4b424 100644 --- a/src/components/report/AnimalForm.tsx +++ b/src/components/report/AnimalForm.tsx @@ -1,3 +1,50 @@ -export default function AnimalForm() { - return
AnimalForm placeholder
+import type { Animal, Owner } from '@/domain/schema/animal' +import Label from '@/components/ui/Label' +import Input from '@/components/ui/Input' +import Select from '@/components/ui/Select' +import { getAllSpecies } from '@/domain/species/registry' + +export interface AnimalFormProps { + animal: Animal + owner: Owner + onChangeAnimal: (next: Animal) => void + onChangeOwner: (next: Owner) => void +} + +export default function AnimalForm({ animal, owner, onChangeAnimal, onChangeOwner }: AnimalFormProps) { + const species = getAllSpecies() + const setA = (patch: Partial) => onChangeAnimal({ ...animal, ...patch }) + return ( +
+ Animal & propriétaire +
+ + +
+
+ + setA({ name: e.target.value })} /> +
+
+ + setA({ breed: e.target.value || undefined })} /> +
+
+ + setA({ age: e.target.value || undefined })} /> +
+
+ + onChangeOwner({ name: e.target.value })} /> +
+
+ ) }