import React, { Component } from 'react'
import { Select } from 'antd';
const Option = Select.Option;

class Checkbox extends Component {
	render() {
		let {
			value,
			options
		} = this.props
		options = options && options instanceof Array === true ? options : []
		value = value && value instanceof Array === true ? value : []
		return (
			<Select mode="multiple" value={value} style={{ width: 120 }} onChange={value=>this.props.onChange(value)}>
				{
					options.map((item,key)=>(
						<Option key={key} value={item.id}>{item.name}</Option>
					))
				}
		    </Select>
		)
	}
}

export default Checkbox
