From 0a4547173f3441d881533e4fe2497c05e45b695f Mon Sep 17 00:00:00 2001 From: Jovan Cvetkovic Date: Wed, 7 Dec 2022 00:27:34 +0100 Subject: [PATCH] [FEATURE] Overview | Update stats to use EUI stats component #156 (#194) Signed-off-by: Jovan Cvetkovic Signed-off-by: Jovan Cvetkovic (cherry picked from commit 9abf9eec25585384b0b75c7b9f6102c20ea78bed) --- .../Overview/components/Widgets/Summary.tsx | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/public/pages/Overview/components/Widgets/Summary.tsx b/public/pages/Overview/components/Widgets/Summary.tsx index e2ebdd361..f7cec1576 100644 --- a/public/pages/Overview/components/Widgets/Summary.tsx +++ b/public/pages/Overview/components/Widgets/Summary.tsx @@ -3,14 +3,14 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { EuiFlexGroup, EuiFlexItem, EuiText, EuiLink } from '@elastic/eui'; -import { ROUTES } from '../../../../utils/constants'; +import { EuiFlexGroup, EuiFlexItem, EuiLink, EuiStat } from '@elastic/eui'; import React, { useCallback, useEffect, useState } from 'react'; import { WidgetContainer } from './WidgetContainer'; import { summaryGroupByOptions } from '../../utils/constants'; import { getOverviewVisualizationSpec, getTimeWithMinPrecision } from '../../utils/helpers'; import { AlertItem, FindingItem } from '../../models/interfaces'; import { createSelectComponent, renderVisualization } from '../../../../utils/helpers'; +import { ROUTES } from '../../../../utils/constants'; export interface SummaryProps { findings: FindingItem[]; @@ -92,26 +92,22 @@ export const Summary: React.FC = ({ alerts, findings }) => { - -

Total active alerts

-
- - {activeAlerts} - + {activeAlerts}} + description="Total active alerts" + textAlign="left" + titleColor="primary" + isLoading={!activeAlerts} + />
- -

Total findings

-
- - {totalFindings} - + {totalFindings}} + description="Total findings" + textAlign="left" + titleColor="primary" + isLoading={!totalFindings} + />