2022-03-31 17:16:30 +00:00
|
|
|
import { Tooltip } from '@vegaprotocol/ui-toolkit';
|
2022-03-30 09:49:48 +00:00
|
|
|
import type { StatFields } from '../../config/types';
|
2022-03-23 17:40:15 +00:00
|
|
|
import { defaultFieldFormatter } from '../table-row';
|
|
|
|
import { GoodThresholdIndicator } from '../good-threshold-indicator';
|
|
|
|
|
|
|
|
export const PromotedStatsItem = ({
|
|
|
|
title,
|
|
|
|
formatter,
|
|
|
|
goodThreshold,
|
|
|
|
value,
|
|
|
|
description,
|
|
|
|
}: StatFields) => {
|
|
|
|
return (
|
2022-03-31 17:16:30 +00:00
|
|
|
<Tooltip description={description} align="start">
|
2022-03-23 17:40:15 +00:00
|
|
|
<div className="px-24 py-16 pr-64 border items-center">
|
|
|
|
<div className="uppercase text-[0.9375rem]">
|
|
|
|
<GoodThresholdIndicator goodThreshold={goodThreshold} value={value} />
|
|
|
|
<span>{title}</span>
|
|
|
|
</div>
|
|
|
|
<div className="mt-4 text-h4 leading-none">
|
|
|
|
{formatter ? formatter(value) : defaultFieldFormatter(value)}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</Tooltip>
|
|
|
|
);
|
|
|
|
};
|