CustomizeFunctionOption.jsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import { withTranslation } from 'react-i18next';
  4. class CustomizeFunctionOption extends React.PureComponent {
  5. render() {
  6. return (
  7. <div className="form-group row">
  8. <div className="col-xs-offset-3 col-xs-9 text-left">
  9. <div className="checkbox checkbox-success">
  10. <input
  11. type="checkbox"
  12. id={this.props.optionId}
  13. checked={this.props.isChecked}
  14. onChange={this.props.onChecked}
  15. />
  16. <label htmlFor={this.props.optionId}>
  17. <strong>{this.props.label}</strong>
  18. </label>
  19. </div>
  20. {this.props.children}
  21. </div>
  22. </div>
  23. );
  24. }
  25. }
  26. CustomizeFunctionOption.propTypes = {
  27. t: PropTypes.func.isRequired, // i18next
  28. optionId: PropTypes.string.isRequired,
  29. label: PropTypes.string.isRequired,
  30. isChecked: PropTypes.bool.isRequired,
  31. onChecked: PropTypes.func.isRequired,
  32. children: PropTypes.array.isRequired,
  33. };
  34. export default withTranslation()(CustomizeFunctionOption);