1 import PropTypes from 'prop-types';
2 import React from 'react';
4 import Item from './Item';
5 import { sortByFinished, sortByResult } from '../../helpers/Participant';
6 import { maySeeResults } from '../../helpers/permissions';
7 import { getRunners } from '../../helpers/Tournament';
8 import { withUser } from '../../helpers/UserContext';
10 const List = ({ round, tournament, user }) => {
11 const runners = maySeeResults(user, tournament, round)
12 ? sortByResult(getRunners(tournament), round)
13 : sortByFinished(getRunners(tournament), round);
14 return <div className="results d-flex flex-wrap">
15 {runners.map(participant =>
18 participant={participant}
20 tournament={tournament}
27 round: PropTypes.shape({
29 tournament: PropTypes.shape({
30 participants: PropTypes.arrayOf(PropTypes.shape({
33 user: PropTypes.shape({
37 export default withUser(List);