Skip to content

Commit d24254d

Browse files
[FEATURE] Overview | Update stats to use EUI stats component #156 (#194) (#203)
Signed-off-by: Jovan Cvetkovic <[email protected]> Signed-off-by: Jovan Cvetkovic <[email protected]> (cherry picked from commit 9abf9ee) Co-authored-by: Jovan Cvetkovic <[email protected]>
1 parent 8f2500b commit d24254d

File tree

1 file changed

+16
-20
lines changed

1 file changed

+16
-20
lines changed

public/pages/Overview/components/Widgets/Summary.tsx

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { EuiFlexGroup, EuiFlexItem, EuiText, EuiLink } from '@elastic/eui';
7-
import { ROUTES } from '../../../../utils/constants';
6+
import { EuiFlexGroup, EuiFlexItem, EuiLink, EuiStat } from '@elastic/eui';
87
import React, { useCallback, useEffect, useState } from 'react';
98
import { WidgetContainer } from './WidgetContainer';
109
import { summaryGroupByOptions } from '../../utils/constants';
1110
import { getOverviewVisualizationSpec, getTimeWithMinPrecision } from '../../utils/helpers';
1211
import { AlertItem, FindingItem } from '../../models/interfaces';
1312
import { createSelectComponent, renderVisualization } from '../../../../utils/helpers';
13+
import { ROUTES } from '../../../../utils/constants';
1414

1515
export interface SummaryProps {
1616
findings: FindingItem[];
@@ -92,26 +92,22 @@ export const Summary: React.FC<SummaryProps> = ({ alerts, findings }) => {
9292
<EuiFlexItem>
9393
<EuiFlexGroup gutterSize="xl">
9494
<EuiFlexItem grow={false}>
95-
<EuiText size="s">
96-
<p>Total active alerts</p>
97-
</EuiText>
98-
<EuiLink
99-
href={`#${ROUTES.ALERTS}`}
100-
style={{ fontSize: 20, textDecoration: 'underline' }}
101-
>
102-
{activeAlerts}
103-
</EuiLink>
95+
<EuiStat
96+
title={<EuiLink href={`#${ROUTES.ALERTS}`}>{activeAlerts}</EuiLink>}
97+
description="Total active alerts"
98+
textAlign="left"
99+
titleColor="primary"
100+
isLoading={!activeAlerts}
101+
/>
104102
</EuiFlexItem>
105103
<EuiFlexItem grow={false}>
106-
<EuiText size="s">
107-
<p>Total findings</p>
108-
</EuiText>
109-
<EuiLink
110-
href={`#${ROUTES.FINDINGS}`}
111-
style={{ fontSize: 20, textDecoration: 'underline' }}
112-
>
113-
{totalFindings}
114-
</EuiLink>
104+
<EuiStat
105+
title={<EuiLink href={`#${ROUTES.FINDINGS}`}>{totalFindings}</EuiLink>}
106+
description="Total findings"
107+
textAlign="left"
108+
titleColor="primary"
109+
isLoading={!totalFindings}
110+
/>
115111
</EuiFlexItem>
116112
</EuiFlexGroup>
117113
</EuiFlexItem>

0 commit comments

Comments
 (0)