import { cn } from "../lib/cn"; interface CheckboxProps { label?: string; checked?: boolean; onChange?: (checked: boolean) => void; disabled?: boolean; className?: string; id?: string; } export const Checkbox = ({ label, checked = false, onChange, disabled = false, className = "", id, }: CheckboxProps) => { const checkboxId = id || (label ? label.toLowerCase().replace(/\s+/g, "-") : undefined); return (
onChange?.(e.target.checked)} disabled={disabled} className={cn( "h-4 w-4 rounded border-ctp-surface1 bg-transparent text-ctp-blue focus:ring-2 focus:ring-ctp-blue focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", className, )} /> {label && ( )}
); };