import React from "react"; import {Modal} from "react-bootstrap"; import {useShopStore} from "./shop_store"; import {useClickAway} from "./options/useClickAway"; import {useRenderCount} from "@uidotdev/usehooks"; export function ShowJSON() { 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); console.log("ShowJSON renders: ", renderCount) const ref = useClickAway((e) => { if (e.type === "mousedown") // ignore touchstart closeDescription() } ); return (<>