1 import PropTypes from 'prop-types';
2 import React from 'react';
3 import { Button } from 'react-bootstrap';
4 import { withTranslation } from 'react-i18next';
5 import { useNavigate } from 'react-router-dom';
7 import { getAvatarUrl } from '../../helpers/User';
8 import i18n from '../../i18n';
10 const Box = ({ discriminator, user }) => {
11 const navigate = useNavigate();
14 return <span>{i18n.t('general.anonymous')}</span>;
19 onClick={() => navigate(`/users/${user.id}`)}
22 <img alt="" src={getAvatarUrl(user)} />
23 <span>{user.username}</span>
25 <span className="text-muted">
34 discriminator: PropTypes.bool,
35 user: PropTypes.shape({
36 discriminator: PropTypes.string,
38 username: PropTypes.string,
42 export default withTranslation()(Box);