CustomizeBehaviorOption.jsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import { withTranslation } from 'react-i18next';
  4. class CustomizeBehaviorOption extends React.PureComponent {
  5. render() {
  6. return (
  7. <React.Fragment>
  8. <h4>
  9. <div className="custom-control custom-radio">
  10. <input
  11. type="radio"
  12. className="custom-control-input"
  13. id={`radioBehavior${this.props.behaviorType}`}
  14. checked={this.props.isSelected}
  15. onChange={this.props.onSelected}
  16. />
  17. <label className="custom-control-label" htmlFor={`radioBehavior${this.props.behaviorType}`}>
  18. {/* eslint-disable-next-line react/no-danger */}
  19. <span dangerouslySetInnerHTML={{ __html: this.props.labelHtml }} />
  20. </label>
  21. </div>
  22. </h4>
  23. {/* render layout description */}
  24. {this.props.children}
  25. </React.Fragment>
  26. );
  27. }
  28. }
  29. CustomizeBehaviorOption.propTypes = {
  30. t: PropTypes.func.isRequired, // i18next
  31. behaviorType: PropTypes.string.isRequired,
  32. labelHtml: PropTypes.string.isRequired,
  33. isSelected: PropTypes.bool.isRequired,
  34. onSelected: PropTypes.func.isRequired,
  35. children: PropTypes.object.isRequired,
  36. };
  37. export default withTranslation()(CustomizeBehaviorOption);