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

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

	render() {
		const {
			hrmLimitedAnalysis
		} = this.props, {
			radioGroup,
			setTimeScopeParams
		} = hrmLimitedAnalysis, {
			maxConfig,
			timeScopeConfig,
		} = 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@d2qo1d`} config={toJS(timeScopeConfig)} onChange={params => setTimeScopeParams(params)} />}
				</div>
				<WeaRadioGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaRadioGroup@xpfnm6`} config={toJS(maxConfig)} />
			</div>
		)
	}
}