import {
	observer
} from 'mobx-react';
import {
	Spin
} from 'antd';

@observer
export default class Form extends React.Component {
	render() {
		const {
			store,
			searchGroupProps={},
			comProps={},
		} = this.props, {
			form,
			loading,
		} = store;

		const style = {
			position: 'absolute',
			top: '50%',
			left: '50%',
			marginLeft: -8,
			marginTop: -8,
		}

		if (loading) {
			return (
				<div style={style}>
					<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@t2q26q`} spinning={true}></Spin>
				</div>
			)
		}

		return (
			<div>{form.render(searchGroupProps,comProps)}</div>
		);
	}
}