'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 physical group in the selected territory returns to reserves after the Karama response.

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

Selected: {boardTerritory(choice.territory).name} · {choice.total.normal} normal · {choice.total.elite} elite forces

} {offer.blocked &&

{offer.blocked}

}
); }