RadioButtonForSerchUserOption.jsx 1001 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import { withTranslation } from 'react-i18next';
  4. class RadioButtonForSerchUserOption extends React.Component {
  5. render() {
  6. const { t, searchType } = this.props;
  7. return (
  8. <div className="radio" key={`${searchType}Match`}>
  9. <input
  10. type="radio"
  11. id={`${searchType}Match`}
  12. className="form-check-radio"
  13. checked={this.props.checked}
  14. onChange={this.props.onChange}
  15. />
  16. <label className="text-capitalize form-check-label ml-3" htmlFor={`${searchType}Match`}>
  17. {t(`admin:user_group_management.add_modal.${searchType}_match`)}
  18. </label>
  19. </div>
  20. );
  21. }
  22. }
  23. RadioButtonForSerchUserOption.propTypes = {
  24. t: PropTypes.func.isRequired, // i18next
  25. searchType: PropTypes.string.isRequired,
  26. checked: PropTypes.bool.isRequired,
  27. onChange: PropTypes.func.isRequired,
  28. };
  29. export default withTranslation()(RadioButtonForSerchUserOption);