<commit_before>import React from 'react';

export default function Encounter(props) {
  return (
    <h1>Home</h1>
  );
}<commit_msg>Refactor. Add all home components<commit_after>import React from 'react';
import TocContainer from './toc-container';
import Monster from './monster';
import Modal from './modal';
import AddMonster from './add-monster';
import SlidePanel from './slide-panel';
import RecentMonster from './recent-monster';

export default class Home extends React.Component {
  constructor(props) {
    super(props);
    this.setModal = this.setModal.bind(this);
  }
  setModal() {
    const { addMonster, selectedMonster, toggleAddWindow } = this.props;
    return (
      <Modal closeEvent={toggleAddWindow}>
        <AddMonster
          monster={selectedMonster}
          submitEvent={addMonster}
        />
      </Modal>
    );
  }
  render() {
    const { data,
            monsters,
            selectedMonster,
            setSelectedMonster,
            showAddWindow,
            showConfirmWindow,
            toggleAddWindow,
            toggleShowWindow } = this.props;
    const modal = showAddWindow ? this.setModal() : null;
    return (
      <div>
        <TocContainer
          buttonEvent={setSelectedMonster}
          data={data}
        />
        <Monster
          data={selectedMonster}
          handleAddWindow={toggleAddWindow}
        />
        {modal}
        <SlidePanel
          closeEvent={toggleShowWindow}
          show={showConfirmWindow}
          timer={3000}
        >
          <RecentMonster monsters={monsters} />
        </SlidePanel>
      </div>
    );
  }
}

Home.propTypes = {
  addMonster: React.PropTypes.func,
  data: React.PropTypes.arrayOf(React.PropTypes.object),
  monsters: React.PropTYpes.arrayOf(),
  selectedMonster: React.PropTypes.shape(),
  setSelectedMonster: React.PropTypes.func,
  showAddWindow: React.PropTypes.bool,
  showConfirmWindow: React.PropTypes.bool,
  toggleAddWindow: React.PropTypes.func,
  toggleShowWindow: React.PropTypes.func
};
{'fraction_non_alphanumeric': 0.11116576487948844, 'fraction_numerical': 0.002951303492375799, 'mean_word_length': 2.5809859154929575, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4976117', 'n_tokens_mistral': 596, 'n_tokens_neox': 588, 'n_words': 117}