'use client'; import { useState } from 'react'; import { HelpTip } from './help-tip'; import { Button } from '@/components/ui/button'; import type { Action, GameView } from '@/game/engine'; export function ChoamBattleFunding({ game: g, act, busy, }: { game: GameView; act: (a: Action) => void; busy: boolean; }) { const me = g.players.find((p) => p.id === g.me)!; const [amount, setAmount] = useState(g.aid.pledged); const deciding = g.decision?.kind === 'choamBattleFunding'; if (!g.advanced || g.phase !== 6 || !me.ally || me.faction !== 'choam') return null; return (

Fund your ally’s battle forces

Set aside spice for your ally’s combat support. Your ally chooses how much to use with each plan. Sealed payments stay reserved; unspent funds return at the end of Battle.

Your current unspent pledge: {g.aid.pledged} spice.

{g.battle?.choamAidBlocked && (

Karama prevents using your funding in this battle. Your pledge remains available for later battles.

)} {deciding && ( )}
); }