communication-react-19
Version:
React library for building modern communication user experiences utilizing Azure Communication Services (React 19 compatible fork)
25 lines • 1.22 kB
JavaScript
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { ControlBarButton } from './ControlBarButton';
import React from 'react';
import { _HighContrastAwareIcon } from './HighContrastAwareIcon';
import { useLocale } from '../localization';
/**
* a button to start RealTimeText
* based on accessibility requirement, real time text cannot be turned off once it is on
*
* Can be used with {@link ControlBar}
*
* @param props - properties for the start RealTimeText button.
* @public
*/
export const StartRealTimeTextButton = (props) => {
const { onStartRealTimeText, isRealTimeTextOn } = props;
const localeStrings = useLocale().strings.startRealTimeTextButton;
const strings = Object.assign(Object.assign({}, localeStrings), props.strings);
const onRenderStartIcon = () => {
return React.createElement(_HighContrastAwareIcon, { disabled: props.disabled, iconName: "RealTimeTextIcon" });
};
return (React.createElement(ControlBarButton, Object.assign({}, props, { strings: strings, onClick: onStartRealTimeText, onRenderOffIcon: onRenderStartIcon, disabled: props.disabled || isRealTimeTextOn })));
};
//# sourceMappingURL=StartRealTimeTextButton.js.map