UNPKG

@botonic/react

Version:

Build Chatbots using React

14 lines 1.05 kB
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime"; import React, { useContext } from 'react'; import SendButtonIcon from '../../assets/send-button.svg'; import { ROLES, WEBCHAT } from '../../constants'; import { WebchatContext } from '../../contexts'; import { ConditionalAnimation } from '../components/conditional-animation'; import { Icon } from './common'; export const SendButton = ({ onClick }) => { const { getThemeProperty } = useContext(WebchatContext); const sendButtonEnabled = getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.enableSendButton, true); const CustomSendButton = getThemeProperty(WEBCHAT.CUSTOM_PROPERTIES.customSendButton, undefined); return (_jsx(_Fragment, { children: sendButtonEnabled || CustomSendButton ? (_jsx(ConditionalAnimation, { children: _jsx("div", Object.assign({ onClick: onClick, role: ROLES.SEND_BUTTON_ICON }, { children: CustomSendButton ? (_jsx(CustomSendButton, {})) : (_jsx(Icon, { src: SendButtonIcon })) })) })) : null })); }; //# sourceMappingURL=send-button.js.map