import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Button } from '@redux-devtools/ui';
import { TiArrowSync } from 'react-icons/ti';
import { toggleSync } from '../../actions';
class SyncButton extends Component {
  shouldComponentUpdate(nextProps) {
    return nextProps.sync !== this.props.sync;
  }
  render() {
    return /*#__PURE__*/React.createElement(Button, {
      title: "Sync actions",
      tooltipPosition: "bottom-left",
      onClick: this.props.onClick,
      mark: this.props.sync && 'base0B'
    }, /*#__PURE__*/React.createElement(TiArrowSync, null));
  }
}
const mapStateToProps = state => ({
  sync: state.instances.sync
});
const actionCreators = {
  onClick: toggleSync
};
export default connect(mapStateToProps, actionCreators)(SyncButton);