CustomizeFunctionOption.jsx 1001 B

1234567891011121314151617181920212223242526272829303132333435363738
  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. <React.Fragment>
  8. <div className="checkbox checkbox-success">
  9. <input
  10. type="checkbox"
  11. id={this.props.optionId}
  12. checked={this.props.isChecked}
  13. onChange={this.props.onChecked}
  14. />
  15. <label htmlFor={this.props.optionId}>
  16. <strong>{this.props.label}</strong>
  17. </label>
  18. </div>
  19. {this.props.children}
  20. </React.Fragment>
  21. );
  22. }
  23. }
  24. CustomizeFunctionOption.propTypes = {
  25. t: PropTypes.func.isRequired, // i18next
  26. optionId: PropTypes.string.isRequired,
  27. label: PropTypes.string.isRequired,
  28. isChecked: PropTypes.bool.isRequired,
  29. onChecked: PropTypes.func.isRequired,
  30. children: PropTypes.object.isRequired,
  31. };
  32. export default withTranslation()(CustomizeFunctionOption);