import {
	observer
} from 'mobx-react';
import {
	toJS
} from 'mobx';
import {
	WeaRadioGroup
} from 'ecCom';

@observer
export default class RadioGroup extends React.Component {
	render() {
		const {
			store
		} = this.props, {
			radioGroupStore,
		} = store, {
			config,
			handleRadioGroupChange
		} = radioGroupStore;

		return (
			<div className='radio-group' 
				onKeyDown={(e) =>{
	                if ( e.keyCode == 13 && e.target.tagName === "INPUT") {
	                  store.search();
	                }
	              }  
	            }
			>
				<WeaRadioGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaRadioGroup@m5ksqy`} 
					config={toJS(config)}
					onChange={handleRadioGroupChange}
				/>
			</div>
		);
	}
}