import type {MouseEvent} from 'react'; import {cn} from '@/lib/utils'; interface SwitchProps { checked: boolean; onCheckedChange: (checked: boolean) => void; disabled?: boolean; id?: string; 'aria-label'?: string; className?: string; } export function Switch({ checked, onCheckedChange, disabled = false, id, className, ...props }: SwitchProps) { // 스위치는 클릭 가능한 행 안에 놓이는 일이 많다 — 토글이 행 선택까지 트리거하지 않게 막는다. const handleClick = (event: MouseEvent) => { event.stopPropagation(); if (!disabled) onCheckedChange(!checked); }; return ( ); }