UNPKG

@botonic/react

Version:

Build Chatbots using React

21 lines 993 B
import { jsx as _jsx } from "react/jsx-runtime"; import { INPUT } from '@botonic/core'; import { renderComponent } from '../util/react'; import { Message } from './message'; const serialize = (message) => { return { text: message }; }; export const WhatsappCatalog = (props) => { const renderBrowser = () => { // Return a dummy message for browser const message = `WhatsApp Catalog would be sent to the user.`; return (_jsx(Message, Object.assign({ json: serialize(message) }, props, { type: INPUT.TEXT }, { children: message }))); }; const renderNode = () => { return ( // @ts-ignore Property 'message' does not exist on type 'JSX.IntrinsicElements'. _jsx("message", Object.assign({}, props, { body: props.body, footer: props.footer, thumbnailProductId: props.thumbnailProductId, type: INPUT.WHATSAPP_CATALOG }))); }; return renderComponent({ renderBrowser, renderNode }); }; //# sourceMappingURL=whatsapp-catalog.js.map