export type ShipmentQuoteProps = { id?: string; label?: string; physicalForces?: number; quote: { cost: number; normalCost: number; ownPayment: number; pledgedPayment: number; } | null; funding: { ownSpice: number; pledgedSpice: number; }; unavailableReasons?: readonly string[]; }; /** Displays only caller-supplied prices and private funding already authorized for * this viewer. The caller validates the selection and controls action availability. */ export function ShipmentQuote({ id, label = 'Reserve shipment', physicalForces, quote, funding, unavailableReasons = [], }: ShipmentQuoteProps) { return (
{label !== 'Reserve shipment' && (

{label}

)}

{quote ? `Shipment cost: ${quote.cost} spice` : 'Shipment cost'}

{quote ? ( quote.normalCost !== quote.cost && (

Normal cost: {quote.normalCost} spice. The applicable rate is included in your shipment cost.

) ) : (

Choose valid forces and funding to see the payment breakdown.

)}
{physicalForces !== undefined && ( <>
Physical forces selected
{physicalForces}
)}
Your available spice
{funding.ownSpice}
Available ally pledge
{funding.pledgedSpice}
{quote && ( <>
Your payment
{quote.ownPayment}
Ally pledge used
{quote.pledgedPayment}
)}
{unavailableReasons.length > 0 && (

Shipment unavailable

)}
); }