'use client'; import { useState } from 'react'; import type { Action, GameView } from '@/game/engine'; import { ecazInquiryAction } from '@/game/nexus-ecaz-inquiry-options'; import { Button } from './ui/button'; type Props = { game: GameView; act: (action: Action) => void; busy: boolean }; export function NexusEcazInquiry({ game, act, busy }: Props) { const [selected, select] = useState(''); const { offer, history } = game.nexusEcazInquiry; if (!offer && !history.length) return null; const target = offer?.targets.find(player => player.id === selected) ?? offer?.targets.find(player => player.id !== game.me) ?? offer?.targets[0]; const action = target ? ecazInquiryAction(game, target.id) : null; return (

Ecaz Nexus · Secret Ally inquiry

{offer && <>

Spend the Ecaz Nexus card to learn whether one player holds any of your native leaders as Traitor Cards. You receive only yes or no, not a name or count. The answer is saved at the time of use.

{offer.blocked &&

{offer.blocked}

} } {!!history.length &&

Earlier answers

    {history.map(receipt =>
  1. Turn {receipt.turn}, phase {receipt.phase} · {game.players.find(player => player.id === receipt.target)?.name ?? 'Player'} held one of your native leaders: {receipt.answer ? 'Yes' : 'No'}.
  2. )}
}
); }