import type { ChangeEvent, ReactNode } from 'react'; import styles from './ToggleSwitch.module.scss'; interface ToggleSwitchProps { checked: boolean; onChange: (value: boolean) => void; label?: ReactNode; ariaLabel?: string; disabled?: boolean; labelPosition?: 'left' | 'right'; } export function ToggleSwitch({ checked, onChange, label, ariaLabel, disabled = false, labelPosition = 'right' }: ToggleSwitchProps) { const handleChange = (event: ChangeEvent) => { onChange(event.target.checked); }; const className = [ styles.root, labelPosition === 'left' ? styles.labelLeft : '', disabled ? styles.disabled : '', ] .filter(Boolean) .join(' '); return ( ); }