import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Button } from '@redux-devtools/ui';
import { MdFiberManualRecord } from 'react-icons/md';
import { pauseRecording } from '../../actions';
class RecordButton extends Component {
  shouldComponentUpdate(nextProps) {
    return nextProps.paused !== this.props.paused;
  }
  render() {
    return /*#__PURE__*/React.createElement(Button, {
      tooltipPosition: "bottom-right",
      mark: !this.props.paused && 'base08',
      title: this.props.paused ? 'Start recording' : 'Pause recording',
      onClick: this.props.pauseRecording
    }, /*#__PURE__*/React.createElement(MdFiberManualRecord, null));
  }
}
function mapDispatchToProps(dispatch, ownProps) {
  return {
    pauseRecording: () => dispatch(pauseRecording(!ownProps.paused))
  };
}
export default connect(null, mapDispatchToProps)(RecordButton);