mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-18 19:44:06 -08:00
3b39f6ae45
* Initial react-ui linting rules Signed-off-by: cstdev <pietomb00@hotmail.com> * Add react linting to build process Move eslint config to its own file to keep package.json clearer. Signed-off-by: cstdev <pietomb00@hotmail.com> * Linting changes from master Signed-off-by: cstdev <pietomb00@hotmail.com> * Move CI linting to makefile and travis Also add trailing comma to multiline imports. Signed-off-by: cstdev <pietomb00@hotmail.com> * Add lint fix target to makefile Signed-off-by: cstdev <pietomb00@hotmail.com> * Lint latest master Signed-off-by: cstdev <pietomb00@hotmail.com>
20 lines
641 B
TypeScript
20 lines
641 B
TypeScript
import React, { FC, memo, CSSProperties } from 'react';
|
|
import { FormGroup, Label, Input, InputProps } from 'reactstrap';
|
|
|
|
interface CheckboxProps extends InputProps {
|
|
wrapperStyles?: CSSProperties;
|
|
}
|
|
|
|
const Checkbox: FC<CheckboxProps> = ({ children, wrapperStyles, id, ...rest }) => {
|
|
return (
|
|
<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}>
|
|
{children}
|
|
</Label>
|
|
</FormGroup>
|
|
);
|
|
};
|
|
|
|
export default memo(Checkbox);
|