{"size": 1004, "ext": "js", "max_stars_repo_path": "src/ui/ListBeerPanel.js", "max_stars_repo_name": "k3rmitt/beer-tender", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/ui/ListBeerPanel.js", "max_issues_repo_name": "k3rmitt/beer-tender", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/ui/ListBeerPanel.js", "max_forks_repo_name": "k3rmitt/beer-tender", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 27.1351351351, "max_line_length": 75, "alphanum_fraction": 0.6932270916}
import React, {PropTypes} from 'react';
import {connect} from 'react-redux';
import ListBeer from './ListBeer';
import ListBeerNav from './ListBeerNav';
import {nextPage, previousPage} from '../actions';

const ListBeerPanel = (
  {currentPage, hasNextPage, previousPage, nextPage, loading},
) => (
  <div
    className={`beer-tender-panel ${loading ? 'fade-in' : ''}`}
    title="ListBeerPanel"
  >
    <ListBeer />
    <ListBeerNav
      onPrevious={currentPage > 1 ? previousPage : null}
      onNext={hasNextPage ? nextPage : null}
    />
  </div>
);

ListBeerPanel.propTypes = {
  currentPage: PropTypes.number,
  hasNextPage: PropTypes.bool,
  previousPage: PropTypes.func,
  nextPage: PropTypes.func,
  loading: PropTypes.bool,
};

const mapStateToProps = ({navigation}) => navigation;
const mapDispatchToProps = dispatch => ({
  nextPage: () => dispatch(nextPage()),
  previousPage: () => dispatch(previousPage()),
});

export default connect(mapStateToProps, mapDispatchToProps)(ListBeerPanel);
