This repository has been archived on 2025-09-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
repertory-ui/src/components/UI/CheckBox/CheckBox.js

32 lines
750 B
JavaScript

import React from 'react';
import './CheckBox.css';
import PropTypes from 'prop-types';
const CheckBox = (props) => {
return (
<div className={'CheckBoxOwner'}>
<label className="CheckBoxLabel">
{props.label}
<input
checked={JSON.parse(props.checked)}
autoFocus={props.autoFocus}
disabled={props.disabled}
onChange={props.changed}
type="checkbox"
/>
<span className="CheckBoxCheckMark" />
</label>
</div>
);
};
CheckBox.propTypes = {
autoFocus: PropTypes.bool,
checked: PropTypes.oneOfType([PropTypes.string, PropTypes.bool]),
disabled: PropTypes.bool,
label: PropTypes.string,
changed: PropTypes.func,
};
export default CheckBox;