diff --git a/packages/ui/src/components/templates/report/components/WebsiteCredibility/WebsiteCredibility.tsx b/packages/ui/src/components/templates/report/components/WebsiteCredibility/WebsiteCredibility.tsx index 99f733f076..ae6b3696af 100644 --- a/packages/ui/src/components/templates/report/components/WebsiteCredibility/WebsiteCredibility.tsx +++ b/packages/ui/src/components/templates/report/components/WebsiteCredibility/WebsiteCredibility.tsx @@ -42,20 +42,6 @@ const engagementMetricsMapper = { const PIE_COLORS = ['#007aff', '#65afff', '#98cafe', '#cde4ff', '#f0f9ff']; -const longDateFormatter = (value: string) => dayjs(value, 'MMMM YYYY').format('MMM YYYY'); - -const longNumberFormatter = (value: number) => { - if (value >= 1_000_000) { - return (value / 1_000_000).toFixed(1).replace(/\.0$/, '') + 'mil'; - } - - if (value >= 1_000) { - return (value / 1_000).toFixed(1).replace(/\.0$/, '') + 'k'; - } - - return value.toString(); -}; - export const WebsiteCredibility: FunctionComponent<{ violations: Array<{ label: string; @@ -157,16 +143,19 @@ export const WebsiteCredibility: FunctionComponent<{ barSize={46} > - - + dayjs(value, 'MMMM YYYY').format('MMM YYYY')} + /> + { if (active && payload && payload.length) { return ( - {`On ${label} the company's website had approx. ${ - payload.at(0)?.value - } visitors`} + {`On ${label} the company's website had approx. ${Intl.NumberFormat( + 'en', + ).format(parseInt(String(payload.at(0)?.value)))} visitors`} ); }
{`On ${label} the company's website had approx. ${ - payload.at(0)?.value - } visitors`}
{`On ${label} the company's website had approx. ${Intl.NumberFormat( + 'en', + ).format(parseInt(String(payload.at(0)?.value)))} visitors`}