import { t, Trans } from '@lingui/macro'; import { withI18n, withI18nProps } from '@lingui/react'; import React, { PureComponent } from 'react'; import { selectors } from '@grafana/e2e-selectors'; import { Button, Icon, LoadingPlaceholder } from '@grafana/ui'; import { UserSession } from 'app/types'; interface Props extends withI18nProps { sessions: UserSession[]; isLoading: boolean; revokeUserSession: (tokenId: number) => void; } class UserSessions extends PureComponent { render() { const { isLoading, sessions, revokeUserSession, i18n } = this.props; if (isLoading) { return Loading sessions...} />; } return (
{sessions.length > 0 && ( <>

Sessions

{sessions.map((session: UserSession, index) => ( {session.isActive ? : } ))}
Last seen Logged on IP address Browser & OS
Now{session.seenAt}{i18n.date(session.createdAt, { dateStyle: 'long' })} {session.clientIp} {session.browser} on {session.os} {session.osVersion}
)}
); } } export default withI18n()(UserSessions);