FEAT-5: add gender-filtered animal pickers to Probeverpaarung parents

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-06 00:07:32 +02:00
parent a1d02c0d4e
commit 16a0016de9
4 changed files with 135 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ import { useMemo, useState } from 'react'
import { de } from '../strings/de'
import { breed, fromDisplayString, type BreedingResult } from '../genetics'
import ParentSelector, { type ParentValue } from '../components/ParentSelector'
import AnimalPicker from '../components/AnimalPicker'
import { isValidGenotype } from '../format/genotypeText'
const EMPTY_PARENT: ParentValue = { genotype: '', animalName: null }
@@ -32,8 +33,28 @@ export default function GenetikPage() {
<p className="muted">{t.subtitle}</p>
<div className="parents-grid">
<ParentSelector label={t.father} value={father} onChange={setFather} />
<ParentSelector label={t.mother} value={mother} onChange={setMother} />
<ParentSelector
label={t.father}
value={father}
onChange={setFather}
picker={
<AnimalPicker
gender="male"
onPick={(g) => setFather({ genotype: g.genotype ?? '', animalName: g.name })}
/>
}
/>
<ParentSelector
label={t.mother}
value={mother}
onChange={setMother}
picker={
<AnimalPicker
gender="female"
onPick={(g) => setMother({ genotype: g.genotype ?? '', animalName: g.name })}
/>
}
/>
</div>
{!bothValid && <p className="muted">{t.needBoth}</p>}