{"size": 912, "ext": "js", "max_stars_repo_path": "src/components/App/campers.js", "max_stars_repo_name": "hcuffy/camper-leadership", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/components/App/campers.js", "max_issues_repo_name": "hcuffy/camper-leadership", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/components/App/campers.js", "max_forks_repo_name": "hcuffy/camper-leadership", "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": 24.0, "max_line_length": 67, "alphanum_fraction": 0.5975877193}
import React from 'react';
import './style.css';
import CamperList from './campers_list';

const listOfCampers = props => {
	const { recent } = props.campers;
	const items = recent.map((camper, idx) => {
		return <CamperList key={idx} number={idx + 1} camper={camper} />;
	});

	return (
		<table className="table table-striped table-bordered">
			<thead>
				<tr>
					<th colSpan="4" className="table-header">
						<h2>Leader Board</h2>
					</th>
				</tr>
				<tr>
					<th scope="col">#</th>
					<th scope="col">Camper</th>
					<th onClick={props.changeSortOrder} scope="col">
						Points 30 Days
						<i className="fa fa-sort" aria-hidden="true" />
					</th>
					<th onClick={props.changeSortOrderAll} scope="col">
						All Time Points
						<i className="fa fa-sort" aria-hidden="true" />
					</th>
				</tr>
			</thead>
			<tbody>{items}</tbody>
		</table>
	);
};

export default listOfCampers;
