import Tooltip from '@material-hu/components/design-system/Tooltip';

import { formatPercentage } from '../../../../utils/formatting';
import { LokaliseTFunction } from 'src/utils/i18n';

export const getStatDisplayText = (
  stat: number,
  t: LokaliseTFunction,
  isThresholdMet = false,
) =>
  isThresholdMet ? (
    formatPercentage(stat)
  ) : (
    <Tooltip description={t('not_enough_data_title')}>
      <span>--</span>
    </Tooltip>
  );
