File size: 901 Bytes
f39f6c2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// components/BenchmarkComparisonSelector.tsx
import React from "react";
import { Checkbox } from "@/components/ui/checkbox";

interface Props {
  allMetrics: string[];
  selected: string[];
  onChange: (metric: string, checked: boolean) => void;
}

export const BenchmarkComparisonSelector: React.FC<Props> = ({
  allMetrics,
  selected,
  onChange,
}) => {
  return (
    <div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-2 mb-4">
      {allMetrics.map((metric) => (
        <div key={metric} className="flex items-center space-x-2">
          <Checkbox
            id={metric}
            checked={selected.includes(metric)}
            onCheckedChange={(checked) => onChange(metric, !!checked)}
          />
          <label htmlFor={metric} className="text-sm">
            {metric.replace(/_/g, " ").toUpperCase()}
          </label>
        </div>
      ))}
    </div>
  );
};