import {
    inject,
    observer
} from 'mobx-react';
import { Top, Search, Table } from '../../public/valhalla/components/index.js';

@inject('hrmQuery')
@observer
export default class Query extends React.Component {
    componentDidMount() {
        const { hrmQuery: { init, setSuperid }, location: { query: { superid } } } = this.props;
        
        setSuperid(superid);
        init();
    }

    render() {
        const { hrmQuery: { topStore, searchStore, tableListStore } } = this.props;
        return (
            <Top ecId={`${this && this.props && this.props.ecId || ''}_Top@mrcnlk`} store={topStore}>
				<Search ecId={`${this && this.props && this.props.ecId || ''}_Search@80cobm`} store={searchStore}/>
				<Table ecId={`${this && this.props && this.props.ecId || ''}_Table@exfqz6`} store={tableListStore}/>
			</Top>
        );
    }
}