'use client'; import type { Action, GameView } from '@/game/engine'; import { bidClaimText, bidPromiseModeSupported } from '@/game/bid-promises'; import { Button } from './ui/button'; type BidPromiseProps = { game: GameView; busy: boolean; send: (action: Action) => void }; /** The server's current guide owns bid feasibility and funding. This leaf only * checks that its personalized event and public action opportunity stay live. */ export function BidPromiseGuideButton(props: BidPromiseProps) { const game = props.game, guide = game.bidPromiseGuide, lot = game.bidPromiseLot; if (!guide || !lot) return null; const actor = game.me, turn = lot.turn, number = lot.lot; const action = guide.action, event = action.bidPromiseEvent, signature = JSON.stringify(action); const canAct = () => { const current = props.game, me = current.players.find(player => player.id === current.me); return !props.busy && current === game && bidPromiseModeSupported(current) && current.status === 'playing' && current.phase === 3 && current.me === actor && current.auction?.active === actor && current.turn === turn && current.bidPromiseLot?.turn === turn && current.bidPromiseLot.lot === number && current.bidPromiseGuide === guide && current.bidPromiseGuide.action === action && JSON.stringify(action) === signature && typeof event === 'string' && (action.type === 'bid' || action.type === 'passBid') && (current.bidPromises.some(promise => promise.event === event && promise.player === actor && promise.turn === turn && promise.lot === number && !promise.fulfilled && !promise.released) || current.mixedBidPromises.some(promise => promise.event === event && promise.player === actor && promise.turn === turn && promise.lot === number && !promise.fulfilled && !promise.released)) && !!me && !me.autopilot && !current.truthtrance && !current.response && !current.decision && !current.phaseOpening && !current.automaticContinuationPending && !current.roomControl?.paused && !current.roomControl?.closed; }; return ; } export function BidPromises(props: BidPromiseProps) { const own = props.game.bidPromises.filter(promise => promise.player === props.game.me); if (!own.length) return null; const waiting = own.some(promise => !promise.fulfilled && !promise.released && props.game.bidPromiseLot?.turn === props.game.turn && promise.turn === props.game.turn && promise.lot === props.game.bidPromiseLot.lot); return

Your bid promises

Yes requires one qualifying bid from your answer until this lot closes, while it remains possible. No forbids every later bid at or above that minimum through the close of this lot. A qualifying declaration fulfills this answer even if another player wins. If you win, the original payment rules still apply.

Bid promise rules.{' '} These commitments concern the current ordinary bank lot. Optional modules and native special auctions are excluded. Ordinary bids keep their existing funding and payment rules.

{waiting && props.game.auction?.active !== props.game.me &&

Your next bid opportunity is still ahead; this promise remains visible while others bid.

} {waiting && }
; }