content: import React, { Component } from 'react';
  import { connect } from 'react-redux';
  import { setArchive } from 'store/app/book/actions';
  
  
  class Archive extends Component {
    constructor(props) {
      super(props);
      this.handleInputChange = this.handleInputChange.bind(this);
    }
  
    handleInputChange(e) {
      e.preventDefault();
      const { onChange, value } = this.props;
      onChange(!value);
    }
  
    render() {
      const { value } = this.props;
      return (
        <div
          style={{ cursor: 'pointer' }}
          className="nav-item nav-link"
          onClick={this.handleInputChange}
          role="link"
          tabIndex="-1"
        >
          {value ? <span className="text-warning">CORE</span> : <span>ARCHIVE</span>}
        </div>
      );
    }
  }
  
  const mapStateToProps = state => ({
    value: state.app.book.archive,
  });
  
  const mapDispatchToProps = ({
    onChange: setArchive,
  });
  
  export default connect(mapStateToProps, mapDispatchToProps)(Archive);
  