import * as RadixToggleGroup from "@radix-ui/react-toggle-group"; import type { ReactNode } from "react"; import { classNames } from "@calcom/lib"; import { Tooltip } from "@calcom/ui"; interface ToggleGroupProps extends Omit { options: { value: string; label: string | ReactNode; disabled?: boolean; tooltip?: string; iconLeft?: ReactNode; }[]; isFullWidth?: boolean; } const OptionalTooltipWrapper = ({ children, tooltipText, }: { children: ReactNode; tooltipText?: ReactNode; }) => { if (tooltipText) { return ( {children} ); } return <>{children}; }; export const ToggleGroup = ({ options, onValueChange, isFullWidth, ...props }: ToggleGroupProps) => { return ( <> {options.map((option) => (
{option.iconLeft && {option.iconLeft}} {option.label}
))}
); };