import {
    inject,
    observer
} from 'mobx-react'
import {
    Spin
} from 'antd'

import FormInfo from './FormInfo';
import TableEdit from './TableEdit';

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

    render() {
        const {
            hrmRecruitLibrary
        } = this.props, {
            formInfo,
        } = hrmRecruitLibrary, {
            loading
        } = formInfo;

        if (loading) {
            return (
                <div className='hrm-loading-center-small'>
                    <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@xttik0`} spinning={loading}></Spin>
                </div>
            )
        } else {
            return (
                <div>
                    <FormInfo ecId={`${this && this.props && this.props.ecId || ''}_FormInfo@4ylc5o`} needTitle={true}/>
                    <TableEdit ecId={`${this && this.props && this.props.ecId || ''}_TableEdit@jkxx3q`} />
                </div>
            )
        }
    }
}