+ {[
+ { key: 'femaleCount' as const, label: 'Weiblich' },
+ { key: 'maleCount' as const, label: 'Männlich' },
+ ].map((item) => {
+ const value = safeCount(correction[item.key])
-
-
-
- setCorrection((p) => ({
- ...p,
- maleCount: safeCount(e.target.value),
- unknownCount: 0,
- }))
- }
- className="mt-1 h-9 w-full rounded-md border border-gray-200 bg-white px-2 text-sm dark:border-white/10 dark:bg-gray-950"
- />
+ return (
+
+
+ {item.label}
+
+
+
+
+
+ {
+ const raw = e.target.value.replace(/\D/g, '')
+ const nextValue = safeCount(raw)
+
+ setCorrection((p) => {
+ const next = {
+ ...p,
+ [item.key]: nextValue,
+ unknownCount: 0,
+ }
+
+ return {
+ ...next,
+ peopleCount: safeCount(next.maleCount) + safeCount(next.femaleCount),
+ }
+ })
+ }}
+ className="h-8 w-full rounded-lg border border-gray-200 bg-white px-1 text-center text-sm font-semibold tabular-nums text-gray-900 shadow-sm dark:border-white/10 dark:bg-gray-950 dark:text-gray-100 md:text-base"
+ />
+
+
+
+
+ )
+ })}