import React, {
	Component
} from 'react';
import { observer } from 'mobx-react';
import {
    WeaDialog
} from 'ecCom';
import FormInfo from '../../coms/FormInfo';

@observer
export default class FormSetting extends Component {
	constructor(props) {
        super(props);
    }

	render() {
		const {
            store
        } = this.props;
        const {
            getDialogBtn,
            formTarget,
            saveFormDialogParams
        } = store;
        const {buttons, menus} = getDialogBtn('form');
        const {
            saveForm,
            saveFormFields
        } = formTarget;
        const dp = {
            ...saveFormDialogParams,
            key: new Date().getTime()
        }

		return (
            <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@ch4t45`} {...dp} buttons={buttons} moreBtn={{datas: menus}}>
                <FormInfo ecId={`${this && this.props && this.props.ecId || ''}_FormInfo@vz09iy`} 
                    center={false}
                    form={saveForm}
                    formFields={saveFormFields}/>
            </WeaDialog>
		)
	}
}