UNPKG

jsx-email

Version:

Render JSX email components to HTML email

18 lines 1.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Conditional = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const Conditional = (props) => { const { children, expression, mso, head } = props; if (typeof expression === 'undefined' && typeof mso === 'undefined') throw new RangeError('jsx-email: Conditional expects the `expression` or `mso` prop to be defined'); if (typeof expression !== 'undefined' && typeof mso !== 'undefined') throw new RangeError('jsx-email: Conditional expects the `expression` or `mso` prop to be defined, not both'); // Always render a JSX custom element with data-* markers. // A rehype plugin will replace this element with proper conditional comments. // @ts-ignore - lower-case custom element tag is valid return ((0, jsx_runtime_1.jsx)("jsx-email-cond", { "data-mso": mso, "data-expression": expression, "data-head": head, children: children })); }; exports.Conditional = Conditional; exports.Conditional.displayName = 'Conditional'; //# sourceMappingURL=conditional.js.map