'use client'; import type { Action, GameView } from '@/game/engine'; import { Button } from '@/components/ui/button'; export function ChoamMarket({ game: g, act, busy, }: { game: GameView; act: (action: Action) => void; busy: boolean; }) { const me = g.players.find((p) => p.id === g.me)!; const market = g.choamMarket!; if (g.decision?.kind === 'choamTradeReply') return ( <>
CHOAM offers{' '} {market.offered?.name ?? 'a card no longer available'} . Choose one card to return. CHOAM will confirm before either hand changes.
{me.hand?.map((c) => ( ))} > ); if (g.decision?.kind === 'choamTradeConfirm') return ( <>Give {market.offered?.name ?? 'an unavailable card'}{' '} and receive{' '} {market.returned?.name ?? 'an unavailable card'}. Both cards move together. This uses your one trade for the turn.
> ); return ( <>The phase is ending. Sell a Worthless card for two spice or a surplus exact duplicate for three. A sale reveals the card and gives the table a Karama response.
{market.worthlessSaleBlocked && ({market.worthlessSaleBlocked}
)} {market.sales?.map((sale) => ( ))} {!market.sales?.length && (No eligible sales remain this phase.
)} {market.canTrade && ( <>Your ally chooses a return card; you confirm the exchange. Offers stay private to the two of you.
{me.hand?.map((c) => ( ))} > )} > ); }