@botonic/react
Version:
Build Chatbots using React
25 lines • 1.22 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.WhatsappProduct = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const core_1 = require("@botonic/core");
const react_1 = require("../util/react");
const message_1 = require("./message");
const serialize = (message) => {
return { text: message };
};
const WhatsappProduct = (props) => {
const renderBrowser = () => {
// Return a dummy message for browser
const message = `WhatsApp Product would be sent to the user.`;
return ((0, jsx_runtime_1.jsx)(message_1.Message, Object.assign({ json: serialize(message) }, props, { type: core_1.INPUT.TEXT }, { children: message })));
};
const renderNode = () => {
return (
// @ts-ignore Property 'message' does not exist on type 'JSX.IntrinsicElements'.
(0, jsx_runtime_1.jsx)("message", Object.assign({}, props, { body: props.body, footer: props.footer, catalogId: props.catalogId, productId: props.productId, type: core_1.INPUT.WHATSAPP_PRODUCT })));
};
return (0, react_1.renderComponent)({ renderBrowser, renderNode });
};
exports.WhatsappProduct = WhatsappProduct;
//# sourceMappingURL=whatsapp-product.js.map
;