2017-01-10 14:05:46 +01:00
|
|
|
import React from 'react'
|
2017-11-06 16:32:04 +01:00
|
|
|
import PropTypes from 'prop-types'
|
2017-01-10 14:05:46 +01:00
|
|
|
import AutocompleteInput from './AutocompleteInput'
|
|
|
|
|
|
|
|
|
|
|
|
class IconInput extends React.Component {
|
|
|
|
static propTypes = {
|
2017-11-06 16:32:04 +01:00
|
|
|
value: PropTypes.array,
|
|
|
|
icons: PropTypes.array,
|
|
|
|
style: PropTypes.object,
|
|
|
|
onChange: PropTypes.func.isRequired,
|
2017-01-10 14:05:46 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static defaultProps = {
|
|
|
|
icons: []
|
|
|
|
}
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return <AutocompleteInput
|
|
|
|
value={this.props.value}
|
|
|
|
options={this.props.icons.map(f => [f, f])}
|
|
|
|
onChange={this.props.onChange}
|
|
|
|
wrapperStyle={this.props.style}
|
|
|
|
/>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default IconInput
|