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:
@@ -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>}
|
||||
|
||||
Reference in New Issue
Block a user