'use client'; import { useId } from 'react'; import { Input } from '@/components/ui/input'; import { TRUTH_CARD_NAMES } from '@/game/truthtrance-card-names'; import type { CardCountFact } from '@/game/truthtrance-card-count'; import { HAND_INVENTORY_LABELS, type HandInventoryFact, } from '@/game/truthtrance-hand-inventory'; export function CardCountFields({ value, onChange, }: { value: T; onChange: (fact: T) => void; }) { const id = useId(); const invalid = !Number.isSafeInteger(value.value) || value.value < 0; return ( <> {value.kind === 'handCount' ? ( ) : ( )}

{value.kind === 'handCount' ? 'Counts copies of this exact named card' : value.category === 'all' ? 'Counts all physical cards' : 'Counts physical cards of the selected primary role'}{' '} in the player’s hand now. Cards in the deck, discard pile, or a separate cache do not count. The answer reveals only whether the comparison is true.

{value.kind === 'handInventory' && value.category !== 'all' && (

Primary roles follow the cards: Weirding Way is a weapon and Chemistry is a defense. Worthless cards stay separate, including for Bene Gesserit or CHOAM. Alternate uses and faction powers do not change this count. Poison Blade and Shield Snooper match both of their printed attack or defense types; Mirror Weapon has no fixed poison or projectile primary role.

)} {invalid && ( )} ); }