Files
MikrotikManager/components/form-kit/form-toggle.tsx

27 lines
565 B
TypeScript

"use client"
import { Switch } from "@/components/ui/switch"
import { cn } from "@/lib/utils"
interface FormToggleProps {
checked: boolean
onChange: (value: boolean) => void
disabled?: boolean
className?: string
ariaLabel?: string
}
function FormToggle({ checked, onChange, disabled, className, ariaLabel }: FormToggleProps) {
return (
<Switch
aria-label={ariaLabel}
checked={checked}
onCheckedChange={onChange}
disabled={disabled}
className={cn(className)}
/>
)
}
export { FormToggle, type FormToggleProps }