UNPKG

@botonic/react

Version:

Build Chatbots using React

22 lines 1.06 kB
import { jsx as _jsx } from "react/jsx-runtime"; import { INPUT } from '@botonic/core'; import { renderComponent } from '../util/react'; import { Message } from './message'; const serialize = _whatsappButtonListProps => { // TODO: Implement to have data persistance in localStorage, not needed for this WhatsApp development return {}; }; export const WhatsappButtonList = (props) => { const renderBrowser = () => { // Return a dummy message for browser const message = `${JSON.stringify(props)}`; return (_jsx(Message, Object.assign({ json: serialize(message) }, props, { type: INPUT.WHATSAPP_BUTTON_LIST }, { children: message }))); }; const renderNode = () => { return ( // @ts-ignore Property 'message' does not exist on type 'JSX.IntrinsicElements'. _jsx("message", Object.assign({}, props, { sections: JSON.stringify(props.sections), type: INPUT.WHATSAPP_BUTTON_LIST }))); }; return renderComponent({ renderBrowser, renderNode }); }; //# sourceMappingURL=whatsapp-button-list.js.map