import {
	inject,
	observer,
} from 'mobx-react'
import {
	toJS
} from 'mobx'
import {
	WeaRadioGroup,
} from 'ecCom'
import {
	i18n
} from '../../public/i18n';

@inject('hrmOnlineAnalysis')
@observer
export default class RadioGroup extends React.Component {
	constructor(props) {
		super(props);
	}

	render() {
		const {
			hrmOnlineAnalysis
		} = this.props, {
			radioGroup,
			setTimeScopeParams,
			clusterConfig,
		} = hrmOnlineAnalysis, {
			maxConfig,
			timeScopeConfig,
			hasSelect,
		} = radioGroup;

		return (
			<div style={{padding: 20}} className='hrm-online-analysis'>
				<div className='hrm-online-analysis-scope'>
					{toJS(timeScopeConfig).length > 0 && <WeaRadioGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaRadioGroup@5s6t9e`} config={toJS(timeScopeConfig)} onChange={params => setTimeScopeParams(params)} />}
				</div>
				<div className='hrm-online-analysis-scope'>
					{hasSelect && <WeaRadioGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaRadioGroup@v3lhmp`} config={toJS(clusterConfig)}  />}
				</div>
				<WeaRadioGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaRadioGroup@g7286l`} config={toJS(maxConfig)} />
			</div>
		)
	}
}