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

import FormInfo from './FormInfo';

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

    getChildren = () => {
        return <FormInfo ecId={`${this && this.props && this.props.ecId || ''}_FormInfo@v2u5mz`} />
    }

    render() {
        const {
            hrmRecruitLibrary
        } = this.props, {
            subDialog,
            closeDialog,
            sButtons,
            sStyle,
            sDropMenuDatas,
        } = hrmRecruitLibrary, {
            title,
            visible,
        } = subDialog;

        return (
            <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@wdhvd0`}
                title={title}
                icon="icon-coms-hrm"
                iconBgcolor="#217346"
                visible={visible}
                hasScroll={true}
                onCancel={() => closeDialog()}
                buttons={sButtons}
                moreBtn={{datas:sDropMenuDatas}}
                style={sStyle}
            >
                <WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@0wfwgv`} datas={sDropMenuDatas}>
                    {visible && this.getChildren()}
                </WeaRightMenu>
            </WeaDialog>
        )

    }
}