import React from 'react'; import {SummaryPopup} from "./options/SummaryPopup"; import {formatMoney} from "./utils"; import {WarningIndicator} from "./CardWarnings"; import {useShopStore} from "./shop_store"; /** * Components that displays the list of card that are used in the crate. * It is a summary of purchase */ export function OrderSummary() { const { currency, crates, total_price, crateParams, deleteCard, setHighlight, resetHighlight, highlighted, clearCrate, delCrate, clearAll } = useShopStore(state =>({ currency: state.currency, crates: state.crates, total_price: state.totalOrderPrice(), crateParams: state.crateParams, deleteCard: state.deleteCard, setHighlight: state.highlightCard, resetHighlight: state.highlightReset, highlighted: state.highlighted, clearAll: state.clearAll, clearCrate: state.clearCrate, delCrate: state.delCrate, })); return (
Remove all cards | |
{crate_type.name} |
{`${currency} ${formatMoney(crate_type.price)}`}
|
{`${item.name_number} ${item.name} ${item.name_codename}`}
|
{`${currency} ${formatMoney(item.price)}`}
{(warnings && warnings.length > 0 ? (
|
Price estimate |
{currency} {formatMoney(total_price)}
|