CheckBoxForSerchUserOption.jsx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import { useTranslation } from 'react-i18next';
  4. class CheckBoxForSerchUserOption extends React.Component {
  5. render() {
  6. const { t, option } = this.props;
  7. return (
  8. <div className="custom-control custom-checkbox custom-checkbox-info" key={`isAlso${option}Searched`}>
  9. <input
  10. type="checkbox"
  11. id={`isAlso${option}Searched`}
  12. className="custom-control-input"
  13. checked={this.props.checked}
  14. onChange={this.props.onChange}
  15. />
  16. <label className="text-capitalize custom-control-label ml-3" htmlFor={`isAlso${option}Searched`}>
  17. {t('admin:user_group_management.add_modal.enable_option', { option })}
  18. </label>
  19. </div>
  20. );
  21. }
  22. }
  23. CheckBoxForSerchUserOption.propTypes = {
  24. t: PropTypes.func.isRequired, // i18next
  25. option: PropTypes.string.isRequired,
  26. checked: PropTypes.bool.isRequired,
  27. onChange: PropTypes.func.isRequired,
  28. };
  29. const CheckBoxForSerchUserOptionWrapperFC = (props) => {
  30. const { t } = useTranslation();
  31. return <CheckBoxForSerchUserOption t={t} {...props} />;
  32. };
  33. export default CheckBoxForSerchUserOptionWrapperFC;