misc_pterodactyl-panel/resources/scripts/components/elements/inputs/Checkbox.tsx

26 lines
656 B
TypeScript
Raw Normal View History

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