Skip to content

Commit

Permalink
[FEATURE] Overview | Update stats to use EUI stats component opensear…
Browse files Browse the repository at this point in the history
…ch-project#156

Signed-off-by: Jovan Cvetkovic <[email protected]>
  • Loading branch information
jovancvetkovic3006 committed Nov 22, 2022
1 parent caad327 commit 38ccf93
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions public/pages/Overview/components/Widgets/Summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

import { EuiFlexGroup, EuiFlexItem, EuiText, EuiLink } from '@elastic/eui';
import { EuiFlexGroup, EuiFlexItem, EuiLink, EuiStat } from '@elastic/eui';
import { ROUTES } from '../../../../utils/constants';
import React, { useCallback, useEffect, useState } from 'react';
import { WidgetContainer } from './WidgetContainer';
Expand Down Expand Up @@ -92,26 +92,22 @@ export const Summary: React.FC<SummaryProps> = ({ alerts, findings }) => {
<EuiFlexItem>
<EuiFlexGroup gutterSize="xl">
<EuiFlexItem grow={false}>
<EuiText size="s">
<p>Total active alerts</p>
</EuiText>
<EuiLink
href={`#${ROUTES.ALERTS}`}
style={{ fontSize: 20, textDecoration: 'underline' }}
>
{activeAlerts}
</EuiLink>
<EuiStat
title={<EuiLink href={`#${ROUTES.ALERTS}`}>{activeAlerts}</EuiLink>}
description="Total active alerts"
textAlign="left"
titleColor="primary"
isLoading={!activeAlerts}
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiText size="s">
<p>Total findings</p>
</EuiText>
<EuiLink
href={`#${ROUTES.FINDINGS}`}
style={{ fontSize: 20, textDecoration: 'underline' }}
>
{totalFindings}
</EuiLink>
<EuiStat
title={<EuiLink href={`#${ROUTES.FINDINGS}`}>{totalFindings}</EuiLink>}
description="Total findings"
textAlign="left"
titleColor="primary"
isLoading={!totalFindings}
/>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
Expand Down

0 comments on commit 38ccf93

Please sign in to comment.