import {useShopStore} from "./shop_store"; import {useClickAway} from "./options/useClickAway"; import {Modal} from "react-bootstrap"; import {Validation} from "./validate"; import React from "react"; // #!render_count import {useRenderCount} from "@uidotdev/usehooks"; export function RFQFeedback() { // #!render_count const renderCount = useRenderCount(); const closeRFQ = useShopStore((state) => state.closeRFQFeedback); const shouldShow = useShopStore((state) => state.shouldShowRFQFeedback); const status = useShopStore((state) => state.processingResult); // #!render_count console.log("RFQFeedback renders: ", renderCount) const ref = useClickAway((e) => { if (e.type === "mousedown") // ignore touchstart closeRFQ() }); return (
{status.status === Validation.OK ? close : close }
{status.message}
) }