UNPKG

@azure/communication-react

Version:

React library for building modern communication user experiences utilizing Azure Communication Services

27 lines 852 B
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import React from 'react'; import { Icon } from '@fluentui/react'; import { isMessageTooLong } from './SendBoxUtils'; /** * @private */ export const onRenderCancelIcon = (className) => { return React.createElement(Icon, { iconName: 'EditBoxCancel', className: className }); }; /** * @private */ export const onRenderSubmitIcon = (className) => { return React.createElement(Icon, { iconName: 'EditBoxSubmit', className: className }); }; function isMessageEmpty(messageText) { return messageText.trim().length === 0; } /** * @private */ export function getMessageState(messageText) { return isMessageEmpty(messageText) ? 'too short' : isMessageTooLong(messageText.length) ? 'too long' : 'OK'; } //# sourceMappingURL=ChatMessageComponentAsEditBoxUtils.js.map