FEAT-5: Probeverpaarung page — free genotype entry, client-side breed(), Farbschlag cards + warnings

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-06 00:06:22 +02:00
parent f7ba1fa70e
commit 5a6326a967
4 changed files with 287 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
/** Helpers for free-text genotype input (parse/validate/preview via GEN-1). */
import { fromDisplayString, genotypeToFarbschlag } from '../genetics'
export function isValidGenotype(genotype: string): boolean {
if (!genotype.trim()) return false
try {
fromDisplayString(genotype)
return true
} catch {
return false
}
}
/** Resolved Farbschlag for a genotype string, or null if empty/invalid. */
export function previewFarbschlag(genotype: string): string | null {
if (!genotype.trim()) return null
try {
return genotypeToFarbschlag(fromDisplayString(genotype))
} catch {
return null
}
}