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

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

	handleTabChange = (key) => {
		this.props.hrmVacationBalance.setTabActiveKey(key);
	}

	render() {
		const {
			tab
		} = this.props.hrmVacationBalance, {
			datas,
			activeKey,
		} = tab;

		return (
			<WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@7fv80i`}
                datas={datas}
                keyParam="key"  
                selectedKey={activeKey}
                onChange={key => this.handleTabChange(key)}
            />
		)
	}
}