import {
    inject,
    observer
} from 'mobx-react'
import {
    WeaDialog,
    WeaRightMenu
} from 'ecCom'

import Tab from './Tab';
import Table from './Table';

@inject('hrmApplicant') //todo
@observer
export default class MainDialog extends React.Component {
    constructor(props) {
        super(props);
    }

    getChildren = () => {
        return (
            <div>
                <Tab ecId={`${this && this.props && this.props.ecId || ''}_Tab@kuhd0u`} />
                <Table ecId={`${this && this.props && this.props.ecId || ''}_Table@4xscmk`} />
            </div>
        )
    }

    render() {
        const {
            hrmApplicant
        } = this.props, {
            mainDialog,
            closeDialog,
            buttons,
            style,
            dropMenuDatas,
        } = hrmApplicant, {
            title,
            visible,
        } = mainDialog;

        return (
            <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@pc1c5i`}
                title={title}
                icon="icon-coms-hrm"
                iconBgcolor="#217346"
                visible={visible}
                hasScroll={true}
                onCancel={() => closeDialog()}
                buttons={buttons}
                style={style}
            >
                <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@qqot0s`} datas={dropMenuDatas}>
                    {visible && this.getChildren()}
                </WeaRightMenu>
            </WeaDialog>
        )

    }
}