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

import BasicInfo from './BasicInfo';
import Table from './Table';

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

	render() {
		const {
			hrmLevelProtection: store
		} = this.props;

		const {
			TABCONFIG,
			tab
		} = store, {
			selectedKey
		} = tab;

		return (
			<div>
				<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@nks5qa`}
	                {...TABCONFIG}
	                {...tab}
	            />
	            {
	            	(selectedKey === '0') ? <BasicInfo ecId={`${this && this.props && this.props.ecId || ''}_BasicInfo@ys72qf`} /> : <Table ecId={`${this && this.props && this.props.ecId || ''}_Table@hdczxw`} />
	            }
            </div>
		)
	}
}