]> git.localhorst.tv Git - alttp.git/blob - resources/js/components/results/List.js
8775529493d6d9909ff1cf3fd9674b41ca62edb7
[alttp.git] / resources / js / components / results / List.js
1 import PropTypes from 'prop-types';
2 import React from 'react';
3
4 import Item from './Item';
5 import { sortByResult } from '../../helpers/Participant';
6
7 const List = ({ round, tournament }) => <div className="results d-flex flex-wrap">
8         {sortByResult(tournament.participants, round).map((participant, index) =>
9                 <Item
10                         index={index}
11                         key={participant.id}
12                         participant={participant}
13                         round={round}
14                         tournament={tournament}
15                 />
16         )}
17 </div>;
18
19 List.propTypes = {
20         round: PropTypes.shape({
21         }),
22         tournament: PropTypes.shape({
23                 participants: PropTypes.arrayOf(PropTypes.shape({
24                 })),
25         }),
26 };
27
28 export default List;