text: // @flow
  
  import { translate } from '../../../../base/i18n';
  import { connect } from '../../../../base/redux';
  import AbstractRecordButton, {
      _mapStateToProps as _abstractMapStateToProps,
      type Props
  } from '../AbstractRecordButton';
  
  declare var interfaceConfig: Object;
  
  /**
   * Maps (parts of) the redux state to the associated props for the
   * {@code RecordButton} component.
   *
   * @param {Object} state - The Redux state.
   * @param {Props} ownProps - The own props of the Component.
   * @private
   * @returns {{
   *     _fileRecordingsDisabledTooltipKey: ?string,
   *     _isRecordingRunning: boolean,
   *     _disabled: boolean,
   *     visible: boolean
   * }}
   */
  export function _mapStateToProps(state: Object, ownProps: Props): Object {
      const abstractProps = _abstractMapStateToProps(state, ownProps);
      let { visible } = ownProps;
  
      if (!interfaceConfig.TOOLBAR_BUTTONS.includes('recording')) {
          visible = false;
      }
  
      if (typeof visible === 'undefined') {
          visible = abstractProps.visible;
      }
  
      return {
          ...abstractProps,
          visible
      };
  }
  
  export default translate(connect(_mapStateToProps)(AbstractRecordButton));
  