import { css } from '@emotion/css'; import React, { FC } from 'react'; import { GrafanaTheme2 } from '@grafana/data'; import { Icon, Tooltip, useStyles2 } from '@grafana/ui'; import { Rule } from 'app/types/unified-alerting'; interface Prom { rule: Rule; } export const RuleHealth: FC = ({ rule }) => { const style = useStyles2(getStyle); if (rule.health === 'err' || rule.health === 'error') { return (
error
); } return <>{rule.health}; }; const getStyle = (theme: GrafanaTheme2) => ({ warn: css` display: inline-flex; flex-direction: row; color: ${theme.colors.warning.text}; & > * + * { margin-left: ${theme.spacing(1)}; } `, });