'use client'; import type { Action, GameView } from '@/game/engine'; import { Button } from './ui/button'; export function MoritaniExtortionNotice({ game }: { game: GameView }) { const deferred = game.extortion?.deferred ?? 0; const pending = game.extortion?.pending; if (!deferred && !pending) return null; const payer = pending && game.players.find((player) => player.id === pending.player); return (
{deferred > 0 && (

Moritani Extortion: {deferred} spice from the bank is set aside for Moritani to collect during Mentat Pause. It is not yet spendable.

)} {pending && ( <>

Moritani has collected the bank award. {payer?.name ?? 'The current player'} {' '}may pay {pending.amount} spice to prevent Extortion’s return, or decline. The first payment ends the opportunity; if everyone declines, the token returns to Moritani’s hidden supply.

Remaining choices: {pending.remaining.map(id => game.players.find(player => player.id === id)?.name ?? id).join(' → ')}.

{pending.saphoReordered &&

Juice of Sapho changed the remaining order. Earlier declines stay finished.

} )}
); } export function MoritaniExtortion({ game, act, busy, }: { game: GameView; act: (action: Action) => void; busy: boolean; }) { const decision = game.decision; const pending = game.extortion?.pending; if ( decision?.kind !== 'moritaniExtortion' || decision.player !== game.me || !pending || pending.player !== game.me || pending.event !== decision.event ) return null; const disabled = busy || !!game.response || !!game.truthtrance; return (

Pay Moritani {pending.amount} spice to remove the Extortion token permanently, or decline. The five-spice bank award has already been collected.

{!pending.canPay && (

You do not have enough spice to pay. You may decline.

)}
); }