UNPKG

@noaignite/react-centra-checkout

Version:

React components and helpers for Centra checkout api

21 lines 689 B
// src/ShipwalletEmbed.tsx import { useEffect } from "react"; import { useCentraSelection } from "./Context.js"; import { HtmlEmbed } from "./internal/HtmlEmbed.js"; import { jsx } from "react/jsx-runtime"; 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" }); } export { ShipwalletEmbed }; //# sourceMappingURL=ShipwalletEmbed.js.map