import { css, cx } from '@emotion/css'; import React from 'react'; import { GrafanaTheme2 } from '@grafana/data'; import { Button, InfoBox, Portal, stylesFactory, useTheme2 } from '@grafana/ui'; import { getModalStyles } from '@grafana/ui/src/components/Modal/getModalStyles'; interface Props { maxConcurrentSessions?: number; } export const TokenRevokedModal = (props: Props) => { const theme = useTheme2(); const styles = getStyles(theme); const modalStyles = getModalStyles(theme); const showMaxConcurrentSessions = Boolean(props.maxConcurrentSessions); const redirectToLogin = () => { window.location.reload(); }; return (

Your session token was automatically revoked because you have reached {` the maximum number of ${ showMaxConcurrentSessions ? props.maxConcurrentSessions : '' } concurrent sessions `} for your account.

To resume your session, sign in again. Contact your administrator or visit the license page to review your quota if you are repeatedly signed out automatically.

); }; const getStyles = stylesFactory((theme: GrafanaTheme2) => { return { infobox: css` margin-bottom: 0; `, text: css` margin: ${theme.spacing(1, 0, 2)}; `, backdrop: css` background-color: ${theme.colors.background.canvas}; opacity: 0.8; `, }; });