import React from "react"; import { Checkbox } from "@/components/ui/checkbox"; import { Button } from "@/components/ui/button"; // Assuming you have a Button component interface Props { allMetrics: string[]; selected: string[]; onChange: (metric: string, checked: boolean) => void; } export const BenchmarkComparisonSelector: React.FC = ({ allMetrics, selected, onChange, }) => { const allSelected = allMetrics.every((metric) => selected.includes(metric)); const toggleAll = () => { allMetrics.forEach((metric) => { const shouldCheck = !allSelected; onChange(metric, shouldCheck); }); }; return ( <>
{allMetrics.map((metric) => (
onChange(metric, !!checked)} />
))}
); };