import React from 'react' ; import { useLocale } from '../localization' ; import { ControlBarButton , ControlBarButtonProps } from './ControlBarButton' ; import { HighContrastAwareIcon } from './HighContrastAwareIcon' ; /**
 * Strings of  MicrophoneButton that can be overridden.
 *
 *  public export interface MicrophoneButtonStrings { /** Label when button is on. */ onLabel : string ; /** Label when button is off. */ offLabel : string ; /** * Tooltip content when the button is disabled. */ tooltipDisabledContent ? : string ; /** Tooltip content when the button is on. */ tooltipOnContent ? : string ; /** Tooltip content when the button is off. */ tooltipOffContent ? : string ; } /**
 * Props for  MicrophoneButton .
 *
 *  public export interface MicrophoneButtonProps extends ControlBarButtonProps { /**
     * Utility property for using this component with `communication react eventHandlers`.
     * Maps directly to the `onClick` property.
     */ onToggleMicrophone ? : ( ) => Promise < void > ; /**
     * Optional strings to override in component
     */ strings ? : Partial < MicrophoneButtonStrings > ; } /**
 * A button to turn microphone on / off.
 *
 * Can be used with  ControlBar .
 *
 *  public export const MicrophoneButton = ( props ) : JSX . Element => { const localeStrings = useLocale ( ) . strings . microphoneButton ; const strings = { ... localeStrings , ... props . strings } ; const onRenderMicOnIcon = ( ) : JSX . Element => ( < HighContrastAwareIcon disabled = { props . disabled } iconName = "ControlButtonMicOn" / > ) ; const onRenderMicOffIcon = ( ) : JSX . Element => ( < HighContrastAwareIcon disabled = { props . disabled } iconName = "ControlButtonMicOff" / > ) ; return ( < ControlBarButton { ... props } onClick = { props . onToggleMicrophone ?? props . onClick } onRenderOnIcon = { props . onRenderOnIcon ?? onRenderMicOnIcon } onRenderOffIcon = { props . onRenderOffIcon ?? onRenderMicOffIcon } strings = { strings } labelKey = { props . labelKey ?? 'microphoneButtonLabel' } / > ) ; } ;