import {
	observer
} from 'mobx-react';
import {
	WeaTop,
	WeaRightMenu,
	WeaLocaleProvider,
} from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;

@observer
export default class Top extends React.Component {
	constructor(props) {
		super(props);
	}

	componentDidMount() {
		this.props.store.getRightMenu();
	}

	render() {
		const {
			store
		} = this.props, {
			top,
			topLoading,
			topButtons,
			breadcrumb,
			dropMenuDatas,
		} = store;

		return (
			<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@6yqc1n`}
				{...top}
				loading={topLoading}
				buttons={topButtons}
				breadcrumb={breadcrumb}
				dropMenuDatas={dropMenuDatas}
			>
				<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@fiq1bm`} datas={dropMenuDatas} collectParams={{favname: getLabel(382806, '职务岗位设置'),favouritetype:5}}>
					{this.props.children}
				</WeaRightMenu>
			</WeaTop>
		);
	}
}