UNPKG

@noaignite/react-centra-checkout

Version:

React components and helpers for Centra checkout api

21 lines (20 loc) 874 B
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); const require_Context = require("./Context.cjs"); const require_internal_HtmlEmbed = require("./internal/HtmlEmbed.cjs"); let react = require("react"); let react_jsx_runtime = require("react/jsx-runtime"); //#region src/ShipwalletEmbed.tsx function ShipwalletEmbed() { const { selection } = require_Context.useCentraSelection(); (0, react.useEffect)(() => { if ("CentraCheckout" in window) window.CentraCheckout?.reInitiate("shipwallet"); }, []); if (!selection?.pluginFields?.shipwallet?.snippet) return null; return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_internal_HtmlEmbed.HtmlEmbed, { html: selection.pluginFields.shipwallet.snippet, id: "centra-shipwallet-snippet" }); } //#endregion exports.ShipwalletEmbed = ShipwalletEmbed; //# sourceMappingURL=ShipwalletEmbed.cjs.map