]> git.localhorst.tv Git - alttp.git/blob - resources/js/components/rounds/List.js
2ac8f1701d9074094e705035c928f326dd5522f4
[alttp.git] / resources / js / components / rounds / List.js
1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { Alert } from 'react-bootstrap';
4 import { withTranslation } from 'react-i18next';
5
6 import Item from './Item';
7 import i18n from '../../i18n';
8
9 const List = ({
10         rounds,
11         tournament,
12 }) => rounds && rounds.length ?
13         <ol className="rounds">
14                 {rounds.map(round =>
15                         <Item
16                                 key={round.id}
17                                 round={round}
18                                 tournament={tournament}
19                         />
20                 )}
21         </ol>
22 :
23         <Alert variant="info">
24                 {i18n.t('rounds.empty')}
25         </Alert>
26 ;
27
28 List.propTypes = {
29         rounds: PropTypes.arrayOf(PropTypes.shape({
30                 id: PropTypes.number,
31         })),
32         tournament: PropTypes.shape({
33         }),
34 };
35
36 export default withTranslation()(List);