import { css } from '@emotion/css'; import React, { FC } from 'react'; import { GrafanaTheme, LoadingState } from '@grafana/data'; import { Icon, Tooltip, useStyles } from '@grafana/ui'; interface Props { state: LoadingState; onClick: () => void; } export const PanelHeaderLoadingIndicator: FC = ({ state, onClick }) => { const styles = useStyles(getStyles); if (state === LoadingState.Loading) { return (
); } if (state === LoadingState.Streaming) { return (
); } return null; }; function getStyles(theme: GrafanaTheme) { return { streamIndicator: css` width: 10px; height: 10px; background: ${theme.colors.textFaint}; box-shadow: 0 0 2px ${theme.colors.textFaint}; border-radius: 50%; position: relative; top: 6px; right: 1px; `, }; }