import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group"; import cx from "classnames"; import React, { ReactElement } from "react"; export interface ToggleItem { value: string; label: string; icon: ReactElement; itemAriaLabel: string; } export type ToggleGroupProps = { items: ToggleItem[]; groupAriaLabel: string; itemProps: string; }; const ToggleGroup = ({ items, groupAriaLabel, itemProps, }: ToggleGroupProps) => { return ( {items.map(({ value, label, icon }, i) => ( {React.cloneElement(icon, { className: "w-5 h-5 text-white", })} ))} ); }; export default ToggleGroup;