'use client'; import { parseRevivalClaim, type RevivalClaim } from '@/game/revival-promises'; import { Input } from './ui/input'; export function revivalClaimInputError(value: unknown): string | null { try { parseRevivalClaim(value); return null; } catch (error) { return error instanceof Error ? error.message : 'Choose a whole physical-force minimum from 1 to 20.'; } } /** The parent fixes this turn; the editor chooses physical counters and a * cumulative minimum without reconstructing native revival feasibility. */ export function RevivalClaimFields(props: { value: RevivalClaim; onChange: (claim: RevivalClaim) => void; disabled?: boolean; }) { const error = revivalClaimInputError(props.value); const change = (value: unknown) => { if (!props.disabled && !revivalClaimInputError(value)) props.onChange(parseRevivalClaim(value)); }; return
; }