// components/ui/Switch.tsx 'use client'; import * as React from 'react'; import clsx from 'clsx'; type SwitchProps = { id?: string; name?: string; checked: boolean; onChange: (checked: boolean) => void; ariaLabel?: string; ariaLabelledBy?: string; ariaDescribedBy?: string; disabled?: boolean; className?: string; }; export default function Switch({ id, name, checked, onChange, ariaLabel, ariaLabelledBy, ariaDescribedBy, disabled = false, className, }: SwitchProps) { const handleChange = (e: React.ChangeEvent) => { if (disabled) return; onChange(e.target.checked); }; return (
); }