UNPKG

@botonic/react

Version:

Build Chatbots using React

25 lines 1.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.WhatsappCatalog = 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 WhatsappCatalog = (props) => { const renderBrowser = () => { // Return a dummy message for browser const message = `WhatsApp Catalog 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, thumbnailProductId: props.thumbnailProductId, type: core_1.INPUT.WHATSAPP_CATALOG }))); }; return (0, react_1.renderComponent)({ renderBrowser, renderNode }); }; exports.WhatsappCatalog = WhatsappCatalog; //# sourceMappingURL=whatsapp-catalog.js.map