1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { Alert, Button } from 'react-bootstrap';
4 import { withTranslation } from 'react-i18next';
5 import { useNavigate } from 'react-router-dom';
7 import i18n from '../../i18n';
9 const Participation = ({ user }) => {
10 const navigate = useNavigate();
12 if (!user || !user.participation || !user.participation.length) {
13 return <Alert variant="info">
14 {i18n.t('users.participationEmpty')}
17 return <div className="participation">
18 {user.participation.map(p => <div key={p.id}>
20 onClick={() => navigate(`/tournaments/${p.tournament_id}`)}
29 Participation.propTypes = {
30 user: PropTypes.shape({
31 participation: PropTypes.arrayOf(PropTypes.shape({
37 export default withTranslation()(Participation);