import { InputHTMLAttributes, forwardRef, ForwardedRef } from 'react'; import clsx from 'clsx'; import styles from './Checkbox.module.scss'; interface Props extends InputHTMLAttributes { label: string; type?: 'switch'; } const Checkbox = forwardRef(({ label, className, type, ...attrs }: Props, ref: ForwardedRef) => { const { disabled } = attrs; const labelClassName = clsx(styles.label, className, disabled && 'disabled'); const inputClassName = clsx(styles.input, type === 'switch' ? styles.switch : styles.checkbox); return ( ); }); export { Checkbox, styles as checkboxStyles }; export type { Props as CheckboxProps };