import {
	observer
} from 'mobx-react';
import {
	WeaTab
} from 'ecCom';

@observer
export default class Search extends React.Component {
	constructor(props) {
		super(props);
	}

	render() {
		const {
			store
		} = this.props, {
			TAB,
			tab,
			searchsBaseValue,
		} = store, {
			form
		} = tab;

		return (
			<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@tjpn2z`} 
				{...TAB}
				{...tab}
				searchsBaseValue={searchsBaseValue}
				searchsAd= {<div
					onKeyDown={ (e) =>{
                        if (e.keyCode == 13 && e.target.tagName === "INPUT") {
                            store.onSearch()
                        }
                    } }
				>{form.render()}</div>}
			/>
		);
	}
}