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' import { useT } from '@/i18n/useT' 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 t = useT() const species = getAllSpecies() const setA = (patch: Partial) => onChangeAnimal({ ...animal, ...patch }) return (
{t('form.animal.legend')}
setA({ name: e.target.value })} />
setA({ breed: e.target.value || undefined })} />
setA({ age: e.target.value || undefined })} />
onChangeOwner({ name: e.target.value })} />
) }