<commit_before>import React from 'react';
import Headline from './headline';

export default class Posts extends React.Component {
  static propTypes = {
    posts: React.PropTypes.arrayOf(
      React.PropTypes.shape({
        urlstring: React.PropTypes.string.isRequired,
        title: React.PropTypes.string.isRequired,
        body: React.PropTypes.string.isRequired,
        created: React.PropTypes.number.isRequired,
        commentcount: React.PropTypes.number.isRequired,
        url: React.PropTypes.string,
        name: React.PropTypes.string.isRequired,
        color: React.PropTypes.string.isRequired,
      })
    ),
    nextPage: React.PropTypes.number,
    prevPage: React.PropTypes.number,
  };

  render() {
    let firstPost = true;
    const nextPage = this.props.nextPage;
    const prevPage = this.props.prevPage;
    return (
      <div className="headlines">
        {this.props.posts.map(post => {
          const retval = (
            <Headline key={post.id} post={post} hasSeparator={!firstPost} />
          );
          firstPost = false;
          return retval;
        })}
        <div className="time-nav-container">
          {prevPage ?
            <a className="button pull-right" href={`?page=${prevPage}`}>Newer Posts</a> : null}
          {nextPage ?
            <a className="button" href={`?page=${nextPage}`}>Older Posts</a> : null}
        </div>
      </div>
    );
  }
}<commit_msg>Real paging<commit_after>import React from 'react';
import Headline from './headline';

export default class Posts extends React.Component {
  static propTypes = {
    posts: React.PropTypes.arrayOf(
      React.PropTypes.shape({
        urlstring: React.PropTypes.string.isRequired,
        title: React.PropTypes.string.isRequired,
        body: React.PropTypes.string.isRequired,
        created: React.PropTypes.number.isRequired,
        commentcount: React.PropTypes.number.isRequired,
        url: React.PropTypes.string,
        name: React.PropTypes.string.isRequired,
        color: React.PropTypes.string.isRequired,
      })
    ),
    nextPage: React.PropTypes.number,
    prevPage: React.PropTypes.number,
  };

  render() {
    let firstPost = true;

    const nextPage = (this.props.nextPage === 0) ? '/' : `?page=${this.props.nextPage}`;
    const prevPage = `?page=${this.props.prevPage}`;

    return (
      <div className="headlines">
        {this.props.posts.map(post => {
          const retval = (
            <Headline key={post.id} post={post} hasSeparator={!firstPost} />
          );
          firstPost = false;
          return retval;
        })}
        <div className="time-nav-container">
          {prevPage ?
            <a className="button pull-right" href={prevPage}`}>Newer Posts</a> : null}
          {nextPage ?
            <a className="button" href={nextPage}>Older Posts</a> : null}
        </div>
      </div>
    );
  }
}
{'fraction_non_alphanumeric': 0.13517241379310344, 'fraction_numerical': 0.0003448275862068965, 'mean_word_length': 2.425029515938607, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 23, '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': '5158165', 'n_tokens_mistral': 867, 'n_tokens_neox': 865, 'n_words': 163}