From 71ecebfa72eaa8f9197557e804f7d981380c7336 Mon Sep 17 00:00:00 2001 From: Bastien Chanot Date: Mon, 18 May 2026 21:30:08 +0200 Subject: [PATCH] feat(report): AnimalForm + owner name with species select --- src/components/report/AnimalForm.tsx | 51 ++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) 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 })} /> +
+
+ ) }