stream-chat-react
Version:
React components to create chat conversations or livestream style chat
9 lines (8 loc) • 506 B
JavaScript
import React from 'react';
import { SendIcon } from './icons';
import { useMessageComposerHasSendableData } from './hooks';
export const SendButton = ({ sendMessage, ...rest }) => {
const hasSendableData = useMessageComposerHasSendableData();
return (React.createElement("button", { "aria-label": 'Send', className: 'str-chat__send-button', "data-testid": 'send-button', disabled: !hasSendableData, onClick: sendMessage, type: 'button', ...rest },
React.createElement(SendIcon, null)));
};