CustomizeBehaviorOption.jsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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="radio radio-primary">
  10. <input type="radio" id={`radioBehavior${this.props.behaviorType}`} checked={this.props.isSelected} onChange={this.props.onSelected} />
  11. <label htmlFor={`radioBehavior${this.props.behaviorType}`}>
  12. {/* eslint-disable-next-line react/no-danger */}
  13. <span dangerouslySetInnerHTML={{ __html: this.props.labelHtml }} />
  14. </label>
  15. </div>
  16. </h4>
  17. {/* render layout description */}
  18. {this.props.children}
  19. </React.Fragment>
  20. );
  21. }
  22. }
  23. CustomizeBehaviorOption.propTypes = {
  24. t: PropTypes.func.isRequired, // i18next
  25. behaviorType: PropTypes.string.isRequired,
  26. labelHtml: PropTypes.string.isRequired,
  27. isSelected: PropTypes.bool.isRequired,
  28. onSelected: PropTypes.func.isRequired,
  29. children: PropTypes.object.isRequired,
  30. };
  31. export default withTranslation()(CustomizeBehaviorOption);