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

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

	render() {
		const {
			radioGroup,
			exportActiveParams,
			setRef,
		} = this.props.hrmVacationBalance, {
			config
		} = radioGroup;

		return (
			config.length > 0 && <WeaRadioGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaRadioGroup@jizqmh`} config={toJS(config)} ref={ref => setRef(ref,'rg')} onChange={params => exportActiveParams(params)}/>
		)
	}
}