import {
	observer
} from 'mobx-react';
import {
	MagicForm,
} from '../../public/sweet-form.js';

@observer
export default class DialogForm extends React.Component {
	constructor(props) {
		super(props);
	}

	render() {
		const {
			store
		} = this.props, {
			dialog,
			FORMCONFIG,
			onFormElementsChange,
		} = store, {
			form
		} = dialog;

		return (
			<MagicForm ecId={`${this && this.props && this.props.ecId || ''}_MagicForm@2gogg5`} 
    			{...dialog} 
    			{...FORMCONFIG}
    			isFormInit={form.isFormInit}
    			onFormElementsChange={datas => onFormElementsChange(datas)}
    		 />
		);
	}
}