import {formatMoney} from "./utils"; import React from "react"; import {useShopStore} from "./shop_store"; import {ProcessOptionsToData} from "./options/Options"; // #!render_count import {useRenderCount} from "@uidotdev/usehooks"; export function SummaryOrderPricedOptions() { // #!render_count const renderCount = useRenderCount(); const currency = useShopStore((state) => state.currency); const optionsPrices = useShopStore((state) => state.order_prices); const updateOptions = useShopStore((state) => state.updateOrderOptions); const options_data = useShopStore((state) => state.order_options_data); const options = ProcessOptionsToData({options: optionsPrices, data: options_data}); // #!render_count console.log("SummaryOrderPricedOptions renders: ", renderCount) return {options.map((option, _i) => (
{option.title}
{`${currency} ${formatMoney(option.price)}`}
))} ; }