]> git.localhorst.tv Git - alttp.git/blob - resources/js/components/applications/Dialog.js
tracker items as svg
[alttp.git] / resources / js / components / applications / Dialog.js
1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { Alert, Button, Modal } from 'react-bootstrap';
4 import { withTranslation } from 'react-i18next';
5
6 import List from './List';
7 import i18n from '../../i18n';
8
9 const Dialog = ({ onHide, show, tournament }) =>
10 <Modal className="applications-dialog" onHide={onHide} show={show}>
11         <Modal.Header closeButton>
12                 <Modal.Title>
13                         {i18n.t('tournaments.applications')}
14                 </Modal.Title>
15         </Modal.Header>
16         <Modal.Body className="p-0">
17                 {tournament.applications && tournament.applications.length ?
18                         <List tournament={tournament} />
19                 :
20                         <Alert variant="info">
21                                 {i18n.t('tournaments.noApplications')}
22                         </Alert>
23                 }
24         </Modal.Body>
25         <Modal.Footer>
26                 <Button onClick={onHide} variant="secondary">
27                         {i18n.t('button.close')}
28                 </Button>
29         </Modal.Footer>
30 </Modal>;
31
32 Dialog.propTypes = {
33         onHide: PropTypes.func,
34         show: PropTypes.bool,
35         tournament: PropTypes.shape({
36                 applications: PropTypes.arrayOf(PropTypes.shape({
37                 }))
38         }),
39 };
40
41 export default withTranslation()(Dialog);