import React, { Component } from 'react';
import { connect } from 'react-redux';
import { Button } from '@redux-devtools/ui';
import { FaThumbtack } from 'react-icons/fa';
import { togglePersist } from '../../actions';
class LockButton extends Component {
  shouldComponentUpdate(nextProps) {
    return nextProps.persisted !== this.props.persisted;
  }
  render() {
    return /*#__PURE__*/React.createElement(Button, {
      tooltipPosition: "bottom",
      disabled: this.props.disabled,
      mark: this.props.persisted && 'base0D',
      title: this.props.persisted ? 'Disable state persisting' : 'Persist state history',
      onClick: this.props.onClick
    }, /*#__PURE__*/React.createElement(FaThumbtack, null));
  }
}
const mapStateToProps = state => ({
  persisted: state.instances.persisted
});
const actionCreators = {
  onClick: togglePersist
};
export default connect(mapStateToProps, actionCreators)(LockButton);