'use client'; import { useId, useState } from 'react'; import type { Action, GameView } from '@/game/engine'; import { bribeAction } from '@/game/bribe-options'; import { faction } from '@/game/catalog'; import { Button } from '@/components/ui/button'; export function Bribes({ game: g, act, busy }: { game: GameView; act: (action: Action) => void; busy: boolean; }) { const [target, setTarget] = useState(''); const [amount, setAmount] = useState('1'); const description = useId(); if (g.status !== 'playing') return null; const options = g.bribeOptions; const recipient = options.targets.find(candidate => candidate.id === target); const player = recipient && g.players.find(candidate => candidate.id === recipient.id); const action = bribeAction(options, target, Number(amount)); return (
Bribes{options.incoming > 0 ? ` · ${options.incoming} spice awaiting Mentat` : ''}

Pay another non-allied faction now. The amount is public; the recipient collects their share at the start of Mentat Pause. Payments made during Mentat Pause wait until the start of next turn's Mentat Pause. A message or promise alone does not pay spice.

Your incoming bribes: {options.incoming} spice, separate from your spendable supply.

{options.blocked ? {options.blocked} : null} {options.targets.length === 0 ?

No non-allied recipient is available.

: (
)}

{recipient ? `You may pay up to ${recipient.maximum} spice to this recipient.` : `Uncommitted spice: ${options.available}. Choose a recipient to see the payment limit.`}

{recipient?.limitation ?

{recipient.limitation}

: null} {recipient && !options.blocked && !action ? {recipient.maximum < 1 ? 'No spice is available for this payment.' : `Enter a whole number from 1 to ${recipient.maximum}.`} : null}

Eligible Bureaucrats may divert two spice to the Bank. AI opponents can receive spice, but do not negotiate deals yet. Bribe rules

); }