import { Callout, Indicator, Intent, Tooltip } from '@vegaprotocol/ui-toolkit'; import type { StatFields } from '../../config/types'; import { defaultFieldFormatter } from '../table-row'; import { useMemo } from 'react'; export const PromotedStatsItem = ({ title, formatter, goodThreshold, value, description, ...props }: StatFields) => { const variant = useMemo( () => goodThreshold ? goodThreshold(value) ? Intent.Success : Intent.Danger : Intent.Primary, [goodThreshold, value] ); return (
{title}
{formatter ? formatter(value) : defaultFieldFormatter(value)}
); };