Alerting: Pluralize error tag (#94157)

This commit is contained in:
Sonia Aguilar 2024-10-02 17:14:35 +02:00 committed by GitHub
parent e22b510cd8
commit fe656229c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,7 +1,7 @@
import { isUndefined, omitBy, pick, sum } from 'lodash';
import pluralize from 'pluralize';
import { Fragment, useDeferredValue, useMemo } from 'react';
import * as React from 'react';
import { Fragment, useDeferredValue, useMemo } from 'react';
import { Badge, Stack } from '@grafana/ui';
import {
@ -121,7 +121,7 @@ export function getComponentsFromStats(
}
if (stats.error) {
statsComponents.push(<Badge color="red" key="errors" text={`${stats.error} errors`} />);
statsComponents.push(<Badge color="red" key="errors" text={`${stats.error} ${pluralize('error', stats.error)}`} />);
}
if (stats.nodata) {