UNPKG

@noaignite/react-centra-checkout

Version:

React components and helpers for Centra checkout api

20 lines (19 loc) 682 B
import { useCentraSelection } from "./Context.js"; import { HtmlEmbed } from "./internal/HtmlEmbed.js"; import { useEffect } from "react"; import { jsx } from "react/jsx-runtime"; //#region src/ShipwalletEmbed.tsx function ShipwalletEmbed() { const { selection } = useCentraSelection(); useEffect(() => { if ("CentraCheckout" in window) window.CentraCheckout?.reInitiate("shipwallet"); }, []); if (!selection?.pluginFields?.shipwallet?.snippet) return null; return /* @__PURE__ */ jsx(HtmlEmbed, { html: selection.pluginFields.shipwallet.snippet, id: "centra-shipwallet-snippet" }); } //#endregion export { ShipwalletEmbed }; //# sourceMappingURL=ShipwalletEmbed.js.map