2022-02-27 01:59:29 +00:00
|
|
|
import React, { forwardRef } from 'react';
|
|
|
|
import styles from './inputs.module.css';
|
|
|
|
import classNames from 'classnames';
|
|
|
|
|
2022-02-27 03:06:47 +00:00
|
|
|
type Props = Omit<React.ComponentProps<'input'>, 'type'> & {
|
|
|
|
indeterminate?: boolean;
|
|
|
|
}
|
2022-02-27 01:59:29 +00:00
|
|
|
|
2022-02-27 03:06:47 +00:00
|
|
|
export default forwardRef<HTMLInputElement, Props>(({ className, indeterminate, ...props }, ref) => (
|
2022-02-27 01:59:29 +00:00
|
|
|
<input
|
|
|
|
ref={ref}
|
|
|
|
type={'checkbox'}
|
2022-02-27 03:06:47 +00:00
|
|
|
className={classNames('form-checkbox', {
|
|
|
|
[styles.checkbox]: true,
|
|
|
|
[styles.indeterminate]: indeterminate,
|
|
|
|
}, className)}
|
|
|
|
{...props}
|
2022-02-27 01:59:29 +00:00
|
|
|
/>
|
|
|
|
));
|