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

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

  componentDidMount() {
    this.props.hrmUsedemand.getRadioGroupDatas();
  }

  componentWillUnmount() {
    this.props.hrmUsedemand.resetRadioGroup();
  }

  render() {
    const {
      hrmUsedemand
    } = this.props, {
      radioGroup,
      radioGroupCallBack
    } = hrmUsedemand, {
      config
    } = radioGroup;

    return (
      <div style={{padding: 16}}>
      {config.length > 0 && <WeaRadioGroup ecId={`${this && this.props && this.props.ecId || ''}_WeaRadioGroup@k2zfpz`}
              config={config}
              onChange={params => radioGroupCallBack(params)}
          /> }
       
        </div>
    )
  }
}