import {formatMoney} from "./utils"; import React from "react"; import {useShopStore} from "./shop_store"; // #!render_count import {useRenderCount} from "@uidotdev/usehooks"; export function SummaryCrateFanTray({crate_index}) { // #!render_count const renderCount = useRenderCount(); const currency = useShopStore((state) => state.currency); const fanTray = useShopStore((state) => state.fanTray); const crate_id = useShopStore((state) => state.crates[crate_index].id); const fanTrayAvailable = useShopStore((state) => state.fanTrayAvailableByIndex(crate_index)); const fanTrayEnabled = useShopStore((state) => state.crates[crate_index].fan_tray); const updateFanTray = useShopStore((state) => state.updateFanTrayOption); // #!render_count console.log("SummaryCrateCard renders: ", renderCount) return (fanTrayAvailable && fanTrayEnabled) ? (  
{fanTray.optionTitle}
{`${currency} ${formatMoney(fanTray.price)}`}
) : null; }