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

class SelectField extends Component {
	render() {
		let {
			value,
			options
		} = this.props
		options = options && options instanceof Array === true ? options : []
		return (
			<Select value={value} className="rep-u-field-search-select" onChange={value=>this.props.onChange(value)}>
				{
					options.map((item,key)=>(
						<Option key={key} value={item.id}>{item.name}</Option>
					))
				}
		    </Select>
		)
	}
}

export default SelectField
