<commit_before>import React from 'react'
import {Link} from 'react-router'

const PAGE_SIZE = 30

const offsetObject = offset => offset ? ({offset}) : undefined
const minOffset = offset => Math.max(offset - PAGE_SIZE, 0)
const maxOffset = offset => offset + PAGE_SIZE

//deep merge is deep indeed
const getNextRoute = (router, offset) => ({
  ...router,
  location: {
    ...router.location,
    query: {
      ...router.location.query,
      offset
    }
  }
})

const routingCallback = (props, offsetSelector) => _ => props.routingActions(props.routename)(getNextRoute(props, offsetSelector(props.offset)))

export default props => (
  <ul className="pager p-pagination-controls">
    {props.offset > 0 ?
      <li>
        <Link to={{pathname:'', query: offsetObject(minOffset(props.offset))}}
              onClick={routingCallback(props, minOffset)}
              className="p-pagination-newer">« Newer items</Link>
      </li>
      : false}
    <li>
      <Link to={{pathname:'', query:offsetObject(maxOffset(props.offset))}}
            onClick={routingCallback(props, maxOffset)}
            className="p-pagination-older">Older items »</Link>
      </li>
  </ul>
)
<commit_msg>Fix "Older items" for any page which is not Home<commit_after>import React from 'react'
import {Link} from 'react-router'

const PAGE_SIZE = 30

const offsetObject = offset => offset ? ({offset}) : undefined
const minOffset = offset => Math.max(offset - PAGE_SIZE, 0)
const maxOffset = offset => offset + PAGE_SIZE

//deep merge is deep indeed
const getNextRoute = (router, offset) => ({
  ...router,
  location: {
    ...router.location,
    query: {
      ...router.location.query,
      offset
    }
  }
})

const routingCallback = (props, offsetSelector) => _ => props.routingActions(props.routename)(getNextRoute(props, offsetSelector(props.offset)))

export default props => (
  <ul className="pager p-pagination-controls">
    {props.offset > 0 ?
      <li>
        <Link to={{pathname: props.location.pathname, query: offsetObject(minOffset(props.offset))}}
              onClick={routingCallback(props, minOffset)}
              className="p-pagination-newer">« Newer items</Link>
      </li>
      : false}
    <li>
      <Link to={{pathname: props.location.pathname, query: offsetObject(maxOffset(props.offset))}}
            onClick={routingCallback(props, maxOffset)}
            className="p-pagination-older">Older items »</Link>
      </li>
  </ul>
)

{'fraction_non_alphanumeric': 0.1466992665036675, 'fraction_numerical': 0.0032599837000814994, 'mean_word_length': 3.2547660311958406, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 39, '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': '3293541', 'n_tokens_mistral': 739, 'n_tokens_neox': 740, 'n_words': 176}