'use client'; import { useState } from 'react'; import type { Action, GameView } from '@/game/engine'; import { TERROR_DEFINITIONS } from '@/game/moritani-terror'; import { grummanCollectionCanAct, grummanCollectionChoice, } from '@/game/grumman-collection-options'; import { Button } from './ui/button'; type Props = { game: GameView; act: (action: Action) => void; busy: boolean }; export function GrummanCollection({ game, act, busy }: Props) { if ( !game.grummanCollection || game.grummanCollection.player !== game.me || game.decision?.kind !== 'grummanCollection' || game.decision.player !== game.me ) return null; return ( ); } function CollectionChoice({ game, act, busy }: Props) { const offer = game.grummanCollection!; const [token, setToken] = useState(offer.tokens[0]?.id ?? ''); const [destination, setDestination] = useState( offer.destinations[0]?.id ?? '', ); const canAct = grummanCollectionCanAct(game); const choice = grummanCollectionChoice(game, token, destination); const disabled = busy || !canAct || !!offer.blocked; return (

Add one available Terror token to a stronghold to collect 4 spice. You receive the spice only after the addition resolves.

{choice.blocked && (

{choice.blocked}

)}

Removal unavailable: {offer.removeBlocked}

); }