<commit_before>import React from 'react';

import GameOfLifeGrid from './GameOfLifeGrid';
import getNextEpoch from '../utils/getNextEpoch';
// import createGrid from '../utils/createGrid';

const initialGrid = [
  [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  [0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  [0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
  [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
];

class GameOfLifePage extends React.Component {
  constructor(props) {
    super(props);

    this.state = {
      grid: initialGrid,
      // grid: createGrid(50, 50),
    };
  }
  componentDidMount() {
    // start the evolution here
    this.evolutionInterval = setInterval(() => {
      this.setState({
        grid: getNextEpoch(this.state.grid),
      });
    }, 500);
  }
  componentWillUnmount() {
    clearInterval(this.evolutionInterval);
  }

  render() {
    return (
      <div>
        <div className="">
          <button onClick={this.props.onStartEvolution}>Start evolution</button>
          <button onClick={this.props.onStopEvolution}>Stop evolution</button>
        </div>
        <GameOfLifeGrid epoch={this.state.grid}/>
      </div>
    );
  }
}

GameOfLifePage.propTypes = {
  onStartEvolution: React.PropTypes.function,
  onStopEvolution: React.PropTypes.function,
};

export default GameOfLifePage;
<commit_msg>removed logic from GameOfLife component<commit_after>import React from 'react';

import GameOfLifeGrid from './GameOfLifeGrid';

class GameOfLife extends React.Component {
  render() {
    return (
      <div>
        <div className="">
          <button onClick={this.props.onStartEvolution}>Start evolution</button>
          <button onClick={this.props.onStopEvolution}>Stop evolution</button>
        </div>
        <GameOfLifeGrid epoch={this.props.epoch}/>
      </div>
    );
  }
}

GameOfLife.propTypes = {
  epoch: React.PropTypes.array.isRequired,
  onStartEvolution: React.PropTypes.function,
  onStopEvolution: React.PropTypes.function,
};

export default GameOfLife;

{'fraction_non_alphanumeric': 0.16651705565529623, 'fraction_numerical': 0.059245960502693, 'mean_word_length': 2.903677758318739, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 22, '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': '942661', 'n_tokens_mistral': 945, 'n_tokens_neox': 816, 'n_words': 232}