/** * * InputEnum * */ import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import { map } from 'lodash'; import styles from './styles.scss'; class InputEnum extends React.Component { // eslint-disable-line react/prefer-stateless-function render() { const customBootstrapClass = this.props.customBootstrapClass ? this.props.customBootstrapClass : 'col-md-6'; return (
{map(this.props.selectOptions, (option, key) => { const isChecked = this.props.value === option.value; const active = isChecked ? styles.active : ""; return ( ) })}
); } } InputEnum.propTypes = { customBootstrapClass: PropTypes.string, handleChange: PropTypes.func, name: PropTypes.string, selectOptions: PropTypes.array, target: PropTypes.string, value: PropTypes.any, } export default InputEnum;