{"size": 1660, "ext": "js", "max_stars_repo_path": "admin_ui/components/Grid/GridPager.js", "max_stars_repo_name": "yeepio/yeep", "max_stars_repo_stars_event_min_datetime": "2018-08-28T13:35:38.000Z", "max_stars_repo_stars_event_max_datetime": "2020-12-11T10:57:18.000Z", "max_issues_repo_path": "admin_ui/components/Grid/GridPager.js", "max_issues_repo_name": "yeepio/yeep", "max_issues_repo_issues_event_min_datetime": "2018-09-26T22:16:37.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-08T22:07:32.000Z", "max_forks_repo_path": "admin_ui/components/Grid/GridPager.js", "max_forks_repo_name": "yeepio/yeep", "max_forks_repo_forks_event_min_datetime": "2020-12-11T10:57:20.000Z", "max_forks_repo_forks_event_max_datetime": "2020-12-11T10:57:20.000Z"}
{"max_stars_count": 5, "max_issues_count": 96, "max_forks_count": 1, "avg_line_length": 25.1515151515, "max_line_length": 79, "alphanum_fraction": 0.5421686747}
import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import noop from 'lodash/noop';

// WIP
const GridPager = ({ hasNext, hasPrevious, onNextClick, onPreviousClick }) => {
  return (
    <React.Fragment>
      <ul className="ml-auto whitespace-no-wrap">
        <li className="px-2 inline-block">
          <button
            className={classnames({
              'opacity-50 cursor-not-allowed': !hasPrevious,
              'pseudolink': hasPrevious,
            })}
            disabled={!hasPrevious}
            onClick={onPreviousClick}
          >
            &laquo; Previous
          </button>
        </li>
{/*        <li className="px-2 inline-block">
          <a href="/">1</a>
        </li>
        <li className="px-2 inline-block">
          <strong>2</strong>
        </li>
        <li className="px-2 inline-block">...</li>
        <li className="px-2 inline-block">
          <a href="/">7</a>
        </li>*/}
        <li className="px-2 inline-block">
          <button
            className={classnames({
              'opacity-50 cursor-not-allowed': !hasNext,
              'pseudolink': hasNext,
            })}
            disabled={!hasNext}
            onClick={onNextClick}
          >
            Next &raquo;
          </button>
        </li>
      </ul>
    </React.Fragment>
  );
};

GridPager.propTypes = {
  hasNext: PropTypes.bool,
  hasPrevious: PropTypes.bool,
  onNextClick: PropTypes.func,
  onPreviousClick: PropTypes.func,
};

GridPager.defaultProps = {
  hasNext: true,
  hasPrevious: true,
  onNextClick: noop,
  onPreviousClick: noop,
};


export default GridPager;
