]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/results/ReportButton.js
open tournament type
[alttp.git] / resources / js / components / results / ReportButton.js
index 0a8c139469db478b09fde94cdd342249dba56d46..ec8f8fd17156e920f7acb74bc14171e48f83a1d1 100644 (file)
@@ -5,11 +5,11 @@ import { withTranslation } from 'react-i18next';
 
 import ReportDialog from './ReportDialog';
 import Icon from '../common/Icon';
-import { findResult } from '../../helpers/Participant';
+import { findResult } from '../../helpers/User';
 import i18n from '../../i18n';
 
-const getButtonLabel = (participant, round) => {
-       const result = findResult(participant, round);
+const getButtonLabel = (user, round) => {
+       const result = findResult(user, round);
        if (round.locked) {
                if (result && result.comment) {
                        return i18n.t('results.editComment');
@@ -25,7 +25,7 @@ const getButtonLabel = (participant, round) => {
        }
 };
 
-const ReportButton = ({ participant, round }) => {
+const ReportButton = ({ round, user }) => {
        const [showDialog, setShowDialog] = useState(false);
 
        return <>
@@ -33,26 +33,26 @@ const ReportButton = ({ participant, round }) => {
                        onClick={() => setShowDialog(true)}
                        variant="secondary"
                >
-                       {getButtonLabel(participant, round)}
+                       {getButtonLabel(user, round)}
                        {' '}
                        <Icon.EDIT title="" />
                </Button>
                <ReportDialog
                        onHide={() => setShowDialog(false)}
-                       participant={participant}
                        round={round}
                        show={showDialog}
+                       user={user}
                />
        </>;
 };
 
 ReportButton.propTypes = {
-       participant: PropTypes.shape({
-       }),
        round: PropTypes.shape({
        }),
        tournament: PropTypes.shape({
        }),
+       user: PropTypes.shape({
+       }),
 };
 
 export default withTranslation()(ReportButton);