]> git.localhorst.tv Git - alttp.git/blob - resources/js/components/tournament/ScoreChartButton.js
tracker medallion controler
[alttp.git] / resources / js / components / tournament / ScoreChartButton.js
1 import PropTypes from 'prop-types';
2 import React, { useState } from 'react';
3 import { Button } from 'react-bootstrap';
4 import { withTranslation } from 'react-i18next';
5
6 import ScoreChartDialog from './ScoreChartDialog';
7 import Icon from '../common/Icon';
8 import i18n from '../../i18n';
9
10 const ScoreChartButton = ({ tournament }) => {
11         const [showDialog, setShowDialog] = useState(false);
12
13         return <>
14                 <Button
15                         onClick={() => setShowDialog(true)}
16                         title={i18n.t('button.chart')}
17                         variant="info"
18                 >
19                         <Icon.CHART title="" />
20                 </Button>
21                 <ScoreChartDialog
22                         onHide={() => setShowDialog(false)}
23                         tournament={tournament}
24                         show={showDialog}
25                 />
26         </>;
27 };
28
29 ScoreChartButton.propTypes = {
30         tournament: PropTypes.shape({
31         }),
32 };
33
34 export default withTranslation()(ScoreChartButton);