'use client'; import { cn } from '@/lib'; import { useControllableValue } from 'ahooks'; import { InputLeft } from '.'; import { Switch as SwitchPrimitive } from 'radix-ui'; const { Root, Thumb } = SwitchPrimitive; type SwitchProps = { value?: boolean; onChange?: (value: boolean) => void; icon?: any; text?: string; } & React.HTMLAttributes; export default function Switch(props: SwitchProps) { const { icon, text, onChange: onChangeProps, value: valueProps, ...rest } = props; const [value, onChange] = useControllableValue(props); return (
); }