import React from 'react';
import Select from 'react-select';
import makeAnimated from 'react-select/animated/'

export default class comboboxmulti 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={id}
                    name={id}
                    id={id}
                    value={value}
                     onChange={onChange}
                     options={datos}
                     isMulti
                     components={makeAnimated()}
                     isDisabled={attributes.readOnly}                    
                >
                    
             </Select>
                 </div>
             </div>    
            
   

        )
    }
}