import React from 'react'; import { Button, InfoBox, Portal, stylesFactory, useTheme } from '@grafana/ui'; import { getModalStyles } from '@grafana/ui/src/components/Modal/getModalStyles'; import { css, cx } from '@emotion/css'; import { GrafanaTheme } from '@grafana/data'; interface Props { maxConcurrentSessions?: number; } export const TokenRevokedModal = (props: Props) => { const theme = useTheme(); 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: GrafanaTheme) => { return { infobox: css` margin-bottom: 0; `, text: css` margin: ${theme.spacing.sm} 0 ${theme.spacing.md}; `, backdrop: css` background-color: ${theme.colors.dashboardBg}; opacity: 0.8; `, }; });