How to use the @bundle-stats/utils.getMetricType function in @bundle-stats/utils

To help you get started, we’ve selected a few @bundle-stats/utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github relative-ci / bundle-stats / packages / ui / src / components / summary-item / summary-item.jsx View on Github external
export const SummaryItem = ({
  className, size, id, data, loading, showBaselineValue, showDelta, showMetricDescription,
}) => {
  const { baseline, current } = data || { baseline: 0, current: 0 };

  const metric = getMetricType(id);
  const diff = getDelta({ value: baseline }, { value: current });

  const rootClassName = cx(
    css.root,
    className,
    css[size],
    showMetricDescription && css.showMetricDescription,
    showBaselineValue && css.showBaselineValue,
  );

  return (
    <div>
      <h3>
        {metric.label}
      </h3>
</div>