// eslint-disable-next-line import React, { Component } from "react"; import { useTranslation } from 'react-i18next'; import Button from '@mui/material/Button'; import ListItemButton from '@mui/material/ListItemButton'; import Paper from '@mui/material/Paper'; import { UserDisplay, VirtualList, AuthGuard, LanguageDropdown } from '@app/components'; import { AuthenticationService, SessionService } from '@app/api'; import { ServerSelectors } from '@app/store'; import Layout from '../Layout/Layout'; import { useAppSelector } from '@app/store'; import AddToBuddies from './AddToBuddies'; import AddToIgnore from './AddToIgnore'; import './Account.css'; const Account = () => { const buddyList = useAppSelector(state => ServerSelectors.getBuddyList(state)); const ignoreList = useAppSelector(state => ServerSelectors.getIgnoreList(state)); const serverName = useAppSelector(state => ServerSelectors.getName(state)); const serverVersion = useAppSelector(state => ServerSelectors.getVersion(state)); const user = useAppSelector(state => ServerSelectors.getUser(state)); const { country, realName, name, userLevel, accountageSecs, avatarBmp } = user || {}; let url = URL.createObjectURL(new Blob([avatarBmp as BlobPart], { 'type': 'image/png' })); const { t } = useTranslation(); const handleAddToBuddies = ({ userName }) => { SessionService.addToBuddyList(userName); }; const handleAddToIgnore = ({ userName }) => { SessionService.addToIgnoreList(userName); }; return (
Buddies Online: ?/{buddyList.length}
( )) } />
Ignored Users Online: ?/{ignoreList.length}
( )) } />
{name}

{name}

Location: ({country?.toUpperCase()})

User Level: {userLevel}

Account Age: {String(accountageSecs)}

Real Name: {realName}

Server Name: {serverName}

Server Version: {serverVersion}

) } export default Account;