'use client'; import { useState } from 'react'; import { ChoamPowerCost, useChoamPower } from './choam-power-cost'; import { choamPowerAction } from '@/game/choam-power-options'; import { Button } from '@/components/ui/button'; import { HelpTip } from './help-tip'; import type { Action, GameView } from '@/game/engine'; import { territory } from '@/game/board'; export function ChoamStorm({ game: g, act, busy, }: { game: GameView; act: (a: Action) => void; busy: boolean; }) { const power = useChoamPower(g, 'jubba'); const [selected, setSelected] = useState(''); const decision = g.decision?.kind === 'choamStorm' ? g.decision : null; if (!decision || decision.player !== g.me) return null; const choice = decision.territories.find((t) => t.territory === selected) ?? decision.territories[0]; return (

Jubba Cloak

Protect your own forces in one territory from this storm movement. Spice and other factions’ forces remain exposed. Karama may cancel this effect.

{decision.protected.length > 0 && (

Protected:{' '} {decision.protected.map((t) => territory(t).name).join(', ')}.

)} {power.play ? ( ) : (

No available Jubba Cloak play. Continue when ready to accept the remaining losses.

)}
); }