'use client'; import { useState } from 'react'; 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 [selected, setSelected] = useState(''); const decision = g.decision?.kind === 'choamStorm' ? g.decision : null; if (!decision || decision.player !== g.me) return null; const card = g.choamWorthless?.cards.find((c) => c.name === 'Jubba Cloak'); 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(', ')}.

)} {card ? ( ) : (

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

)}
); }