docs: add JSDoc comments to createChartArray function in Metric component for better documentation

This commit is contained in:
Adam Shiervani 2025-08-28 12:05:18 +02:00
parent 8a07f7d186
commit 0340aa3749
1 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,4 @@
/* eslint-disable react-refresh/only-export-components */
import { ComponentProps } from "react";
import { cva, cx } from "cva";
@ -28,7 +29,12 @@ interface MetricProps<T, K extends keyof T> {
badgeTheme?: ComponentProps<typeof MetricHeader>["badgeTheme"];
}
/* eslint-disable-next-line */
/**
* Creates a chart array from a metrics map and a metric name.
*
* @param metrics - Expected to be ordered from oldest to newest.
* @param metricName - Name of the metric to create a chart array for.
*/
export function createChartArray<T, K extends keyof T>(
metrics: Map<number, T>,
metricName: K,