2019-10-26 10:50:22 -07:00
|
|
|
import React, { FC, memo, CSSProperties } from 'react';
|
|
|
|
import { FormGroup, Label, Input, InputProps } from 'reactstrap';
|
2019-10-23 13:18:41 -07:00
|
|
|
|
2019-10-26 10:50:22 -07:00
|
|
|
interface CheckboxProps extends InputProps {
|
|
|
|
wrapperStyles?: CSSProperties;
|
|
|
|
}
|
|
|
|
|
|
|
|
const Checkbox: FC<CheckboxProps> = ({ children, wrapperStyles, id, ...rest }) => {
|
2019-10-23 13:18:41 -07:00
|
|
|
return (
|
2019-10-26 10:50:22 -07:00
|
|
|
<FormGroup className="custom-control custom-checkbox" style={wrapperStyles}>
|
|
|
|
<Input {...rest} id={id} type="checkbox" className="custom-control-input" />
|
|
|
|
<Label style={{ userSelect: 'none' }} className="custom-control-label" for={id}>
|
2019-10-23 13:18:41 -07:00
|
|
|
{children}
|
|
|
|
</Label>
|
|
|
|
</FormGroup>
|
2019-10-28 07:02:42 -07:00
|
|
|
);
|
|
|
|
};
|
2019-10-23 13:18:41 -07:00
|
|
|
|
|
|
|
export default memo(Checkbox);
|