
/**
 * Created at 2018/3/14.
 * @Author Ling.
 * @Email i@zeroling.com
 */
import React, { Component } from 'react';
import { Input } from '@icedesign/base';

export default class SearchInput extends Component {
  static displayName = 'SearchInput';

  state = {
    value: ''
  };

  render() {
    return (
      <Input
        value={this.state.value}
        onChange={value => {
          this.setState({
            value: value
          });
        }}
        placeholder="搜索：标题/花名，回车确认"
        style={{ width: 240 }}
        size="large"
        onPressEnter={e => {
          this.props.onPressEnter(e.target.value);
          this.setState({
            value: ''
          });
        }}
      />
    );
  }
}
