import { useId } from "@radix-ui/react-id"; import * as Label from "@radix-ui/react-label"; import * as PrimitiveSwitch from "@radix-ui/react-switch"; import React from "react"; import cx from "@calcom/lib/classNames"; import { Tooltip } from "../../tooltip"; const Wrapper = ({ children, tooltip }: { tooltip?: string; children: React.ReactNode }) => { if (!tooltip) { return <>{children}; } return {children}; }; const Switch = ( props: React.ComponentProps & { label?: string; fitToHeight?: boolean; disabled?: boolean; tooltip?: string; labelOnLeading?: boolean; classNames?: { container?: string; thumb?: string; }; } ) => { const { label, fitToHeight, classNames, labelOnLeading, ...primitiveProps } = props; const id = useId(); const isChecked = props.checked || props.defaultChecked; return (
{label && ( {label} )}
); }; export default Switch;