import { useAutoAnimate } from "@formkit/auto-animate/react"; import type { ReactNode } from "react"; import { classNames } from "@calcom/lib"; import { Label } from ".."; import Switch from "./Switch"; type Props = { children?: ReactNode; title: string; description?: string; checked: boolean; disabled?: boolean; LockedIcon?: React.ReactNode; Badge?: React.ReactNode; onCheckedChange?: (checked: boolean) => void; "data-testid"?: string; tooltip?: string; toggleSwitchAtTheEnd?: boolean; childrenClassName?: string; switchContainerClassName?: string; labelClassName?: string; }; function SettingsToggle({ checked, onCheckedChange, description, LockedIcon, Badge, title, children, disabled, tooltip, toggleSwitchAtTheEnd = false, childrenClassName, switchContainerClassName, labelClassName, ...rest }: Props) { const [animateRef] = useAutoAnimate(); return ( <>
{toggleSwitchAtTheEnd ? (
{Badge &&
{Badge}
}
{description &&

{description}

}
) : (
{description &&

{description}

}
)} {children && (
{checked &&
{children}
}
)}
); } export default SettingsToggle;