'use client'; import { useState } from 'react'; import { territory as boardTerritory } from '@/game/board'; import type { Action, GameView } from '@/game/engine'; import { nexusCardReference } from '@/game/nexus-card-reference'; import { ecazBetrayalAction } from '@/game/nexus-ecaz-betrayal-options'; import { Button } from './ui/button'; type Props = { game: GameView; act: (action: Action) => void; busy: boolean }; export function NexusEcazBetrayal({ game, act, busy }: Props) { const [selected, select] = useState(''); const offer = game.nexusEcazBetrayal; if (!offer || game.nexusCards?.card !== 'ecaz' || !game.players.some(player => player.id === game.me)) return null; const choice = offer.territories.find(candidate => candidate.territory === selected) ?? offer.territories[0]; const action = choice ? ecazBetrayalAction(game, choice.territory) : null; const ally = game.players.find(player => player.id === offer.ally); return (

Ecaz Nexus · Betrayal

{nexusCardReference('ecaz').betrayal}

{ally &&

Ecaz’s ally: {ally.name}. Their entire group in the selected territory returns to reserves if the Karama response allows Betrayal.

} {offer.territories.length > 1 && } {choice &&

Selected: {boardTerritory(choice.territory).name} · {choice.total.normal} visible normal · {choice.total.elite} visible elite forces{choice.concealed ? ' · one concealed No-Field' : ''}

} {choice?.concealed &&

The No-Field returns face-down without revealing its value. Cancellation leaves the marker and all forces in place.

} {offer.blocked &&

{offer.blocked}

}
); }