import React from "react"; import {Modal} from "react-bootstrap"; import {useShopStore} from "./shop_store"; import {useClickAway} from "./options/useClickAway"; // #!render_count import {useRenderCount} from "@uidotdev/usehooks"; export function ShowJSON() { // #!render_count const renderCount = useRenderCount(); const shouldShow = useShopStore((state) => state.shouldShowDescription); const description = useShopStore((state) => state.description); const closeDescription = useShopStore((state) => state.closeDescription); const showDescription = useShopStore((state) => state.showDescription); // #!render_count console.log("ShowJSON renders: ", renderCount) const ref = useClickAway((e) => { if (e.type === "mousedown") // ignore touchstart closeDescription() } ); return (<>