/* * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * * Modifications Copyright OpenSearch Contributors. See * GitHub history for details. */ import React, { Fragment } from 'react'; import { EuiIcon, EuiLink, EuiToolTip, EuiTitle } from '@elastic/eui'; import { Monitor } from '../../../../models/interfaces'; import { getAlertingMonitorListLink } from '../../../../utils/utils'; import { formatNumber } from '../../../utils/helpers'; interface AnomalyStatProps { title: any; description: any; } export const AnomalyStat = (props: AnomalyStatProps) => { return (
{props.description}
{props.title}
); }; export const AnomalyStatWithTooltip = (props: { isLoading: boolean; minValue: number | undefined; maxValue: number | undefined; description: string; tooltip: string; }) => { const title = () => { return props.isLoading ? '-' : !props.maxValue ? '0' : `${formatNumber(props.minValue)}-${formatNumber(props.maxValue)}`; }; const description = () => { return (

{props.description}{' '}

); }; return ; }; export const AlertsStat = (props: { monitor: Monitor | undefined; showAlertsFlyout(): void; totalAlerts: number | undefined; isLoading: boolean; }) => { const title = () => { return (

{props.totalAlerts === undefined || props.isLoading ? '-' : props.totalAlerts}{' '}

{props.monitor ? ( View monitor ) : null}
); }; const description = () => { return (

Alert{' '} Info

); }; return ; };