]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/rounds/List.js
svg dungeon tracker
[alttp.git] / resources / js / components / rounds / List.js
index 928f7b97eac3bb4f5882ae0b35780f942abe1ba7..5aa2a4c77eece85242122452edf11c6c7070c787 100644 (file)
@@ -4,29 +4,34 @@ import { Alert } from 'react-bootstrap';
 import { withTranslation } from 'react-i18next';
 
 import Item from './Item';
+import LoadMore from './LoadMore';
 import i18n from '../../i18n';
 
 const List = ({
+       loadMore,
        rounds,
        tournament,
-}) => rounds && rounds.length ?
+}) => rounds && rounds.length ? <>
        <ol className="rounds">
-               {rounds.map((round, index) =>
+               {rounds.map(round =>
                        <Item
-                               index={index}
                                key={round.id}
                                round={round}
                                tournament={tournament}
                        />
                )}
        </ol>
-:
+       {loadMore ?
+               <LoadMore loadMore={loadMore} />
+       : null}
+</> :
        <Alert variant="info">
                {i18n.t('rounds.empty')}
        </Alert>
 ;
 
 List.propTypes = {
+       loadMore: PropTypes.func,
        rounds: PropTypes.arrayOf(PropTypes.shape({
                id: PropTypes.number,
        })),