X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Fresults%2FReportButton.js;h=ec8f8fd17156e920f7acb74bc14171e48f83a1d1;hb=537b998e8059c56e3a20ee2a89d42c3bbfbb80b8;hp=0a8c139469db478b09fde94cdd342249dba56d46;hpb=3e970c52e6a46cf9db4f69c5bec9102da53c0744;p=alttp.git
diff --git a/resources/js/components/results/ReportButton.js b/resources/js/components/results/ReportButton.js
index 0a8c139..ec8f8fd 100644
--- a/resources/js/components/results/ReportButton.js
+++ b/resources/js/components/results/ReportButton.js
@@ -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)}
{' '}
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);