export type ShipmentQuoteProps = { id?: string; label?: string; physicalForces?: number; noField?: true; 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, noField, 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.

) ) : (

{noField ? 'Choose a valid marker, force group and funding to see the payment breakdown.' : 'Choose valid forces and funding to see the payment breakdown.'}

)}
{physicalForces !== undefined && ( <>
Physical forces selected
{physicalForces}
)} {noField && <>
Concealed No-Field selected
1 marker
}
Your available spice
{funding.ownSpice}
Available ally pledge
{funding.pledgedSpice}
{quote && ( <>
Your payment
{quote.ownPayment}
Ally pledge used
{quote.pledgedPayment}
)}
{noField &&

The concealed marker is billed as one shipment unit. It is excluded from the physical force count.

} {unavailableReasons.length > 0 && (

Shipment unavailable

)}
); }