UNPKG

stream-chat-react

Version:

React components to create chat conversations or livestream style chat

11 lines (10 loc) 612 B
import React from 'react'; import { SendIcon } from './icons'; import { useMessageComposerHasSendableData } from './hooks'; import { useTranslationContext } from '../../context'; export const SendButton = ({ sendMessage, ...rest }) => { const { t } = useTranslationContext(); const hasSendableData = useMessageComposerHasSendableData(); return (React.createElement("button", { "aria-label": t('aria/Send'), className: 'str-chat__send-button', "data-testid": 'send-button', disabled: !hasSendableData, onClick: sendMessage, type: 'button', ...rest }, React.createElement(SendIcon, null))); };