import React from 'react';
import Select from 'react-select';

class combobox extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            value: {}

        };
    }


    render() {
        const { id, col, attributes, value, label, datos, onChange } = this.props;
        const readOnlyAttr = attributes.readOnly ? { readOnly: 'readOnly' } : {};
        const stilo = { display: !!attributes.hidden ? attributes.hidden : 'unset' };
        return (

            <div className={"col-sm-" + col + " col-md-" + col} style={stilo}>
                <div className="form-group">
                    <label htmlFor={id}>{label}</label>
                    <Select
                        //id="cb_Moneda"
                        name={id}
                        id={id}
                        value={value}
                        onChange={onChange}
                        options={datos}
                        isDisabled={attributes.readOnly}
                        placeholder={label}
                    >

                    </Select>
                </div>
            </div>



        )
    }
}
export default combobox
//export default LoaderHOC('datos')(combobox); 