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 SummaryCratePricedOptions({crate_index}) { // #!render_count const renderCount = useRenderCount(); const currency = useShopStore((state) => state.currency); const crate_id = useShopStore((state) => state.crates[crate_index].id); const optionsPrices = useShopStore((state) => state.crate_prices); const updateOptions = useShopStore((state) => state.updateCrateOptions); const options_data = useShopStore((state) => state.crates[crate_index].options_data || {}); const options = ProcessOptionsToData({options: optionsPrices, data: options_data}); // #!render_count console.log("SummaryCratePricedOptions renders: ", renderCount) return options.map((option, _i) => (