diff --git a/libs/network-stats/src/components/good-threshold-indicator/good-threshold-indicator.tsx b/libs/network-stats/src/components/good-threshold-indicator/good-threshold-indicator.tsx deleted file mode 100644 index 0e7d517c2..000000000 --- a/libs/network-stats/src/components/good-threshold-indicator/good-threshold-indicator.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import type { value, goodThreshold } from '../../config/types'; - -interface GoodThresholdIndicatorProps { - goodThreshold: goodThreshold | undefined; - value: value; -} - -export const GoodThresholdIndicator = ({ - goodThreshold, - value, -}: GoodThresholdIndicatorProps) => { - return ( -
- ); -}; diff --git a/libs/network-stats/src/components/good-threshold-indicator/index.ts b/libs/network-stats/src/components/good-threshold-indicator/index.ts deleted file mode 100644 index 6ffd483b7..000000000 --- a/libs/network-stats/src/components/good-threshold-indicator/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { GoodThresholdIndicator } from './good-threshold-indicator'; diff --git a/libs/network-stats/src/components/promoted-stats-item/promoted-stats-item.tsx b/libs/network-stats/src/components/promoted-stats-item/promoted-stats-item.tsx index 8e1fe15b4..d36fac649 100644 --- a/libs/network-stats/src/components/promoted-stats-item/promoted-stats-item.tsx +++ b/libs/network-stats/src/components/promoted-stats-item/promoted-stats-item.tsx @@ -1,7 +1,8 @@ import { Tooltip } from '@vegaprotocol/ui-toolkit'; import type { StatFields } from '../../config/types'; import { defaultFieldFormatter } from '../table-row'; -import { GoodThresholdIndicator } from '../good-threshold-indicator'; +import { Card, Indicator, Variant } from '@vegaprotocol/ui-toolkit'; +import { useMemo } from 'react'; export const PromotedStatsItem = ({ title, @@ -10,17 +11,26 @@ export const PromotedStatsItem = ({ value, description, }: StatFields) => { + const variant = useMemo( + () => + goodThreshold + ? goodThreshold(value) + ? Variant.Success + : Variant.Danger + : Variant.Highlight, + [goodThreshold, value] + ); return (