-const List = ({ round, tournament }) => <div className="results d-flex">
- {tournament.participants.map(participant =>
- <Item
- key={participant.id}
- participant={participant}
- round={round}
- tournament={tournament}
- />
- )}
-</div>;
+const List = ({ round, tournament, user }) => {
+ if (tournament.type === 'open-async') {
+ const results = maySeeResults(user, tournament, round)
+ ? (round.results || []).sort(compareResult)
+ : round.results || [];
+ return <div className="results d-flex flex-wrap">
+ {results.map(result =>
+ <Item
+ key={result.id}
+ round={round}
+ tournament={tournament}
+ user={result.user}
+ />
+ )}
+ </div>;
+ }
+ const runners = maySeeResults(user, tournament, round)
+ ? sortByResult(getRunners(tournament), round)
+ : sortByFinished(getRunners(tournament), round);
+ return <div className="results d-flex flex-wrap">
+ {runners.map(participant =>
+ <Item
+ key={participant.id}
+ round={round}
+ tournament={tournament}
+ user={participant.user}
+ />
+ )}
+ </div>;
+};