'use client'; import { useState } from 'react'; import type { Action, GameView } from '@/game/engine'; import { nexusChoamTradeAction } from '@/game/nexus-choam-trade-options'; import { CardInspector, CardRules } from './card-inspector'; import { Button } from './ui/button'; type Props = { game: GameView; act: (action: Action) => void; busy: boolean }; export function NexusChoamTrade({ game, act, busy }: Props) { const [selected, select] = useState(''); const offer = game.nexusChoamTrade; if (!offer) return null; const card = offer.cards.find(choice => choice.id === selected) ?? offer.cards[0]; const action = card ? nexusChoamTradeAction(game, card.id) : null; return (

CHOAM Nexus · Secret Ally

During Spice Collection, discard one Worthless card to receive two spice from the bank. This also spends your CHOAM Nexus card.

{offer.cards.length > 1 && ( )} {card &&
{card.name}
} {offer.blocked &&

{offer.blocked}

}

Optional: keep both cards by continuing the phase. The same card can instead be spent after a battle victory to inspect one unused opposing card.

); } export function NexusChoamInspectionDecision({ game, act, busy }: Props) { const offer = game.nexusChoamInspection; if (!offer) return null; const opponent = game.players.find(player => player.id === offer.opponent); return (

After victory · CHOAM Secret Ally

Every winner receives this private choice. If you hold the CHOAM Nexus card while unallied, you may spend it to inspect one random unused card held by {opponent?.name ?? 'your opponent'}. Otherwise continue.

{offer.canInspect && ( )}
); } export function NexusChoamInspectionInsight({ game }: { game: GameView }) { const insight = game.nexusChoamInsight; if (!insight) return null; const opponent = game.players.find(player => player.id === insight.target); return (

Your CHOAM Nexus inspection · {opponent?.name}

Only you see this card. It was in the opposing hand when the battle ended; it may move afterward. This snapshot remains until the next battle or turn.

{insight.card.name}

); }