import React from 'react'; import { FormGroup, FormSelect, FormSelectOption, GridItem, } from '@patternfly/react-core'; import { translate as __ } from 'foremanReact/common/I18n'; import PropTypes from 'prop-types'; const FormField = ({ label, id, value, items, onChange, isLoading, contentHostsCount, }) => ( onChange(v)} className="without_select2" isDisabled={isLoading || items.length === 0 || contentHostsCount === 0} id={`${id}_select`} isRequired > { items.map(item => ( ))} ); FormField.propTypes = { label: PropTypes.string.isRequired, id: PropTypes.string.isRequired, value: PropTypes.string.isRequired, items: PropTypes.arrayOf(PropTypes.object).isRequired, onChange: PropTypes.func.isRequired, isLoading: PropTypes.bool.isRequired, contentHostsCount: PropTypes.number.isRequired, }; export default FormField;