import {
    observer
} from 'mobx-react'
import {
    Loading,
} from '../../public/learn.js'
import { MagicForm } from '../../public/valhalla/components/index.js'

@observer
export default class Form extends React.Component {
    componentDidMount() {
        const { store: { getForm } } = this.props
        getForm()
    }

    render() {
        const { store: { formStore } } = this.props
        const { loading } = formStore

        if (loading) {
            return <Loading ecId={`${this && this.props && this.props.ecId || ''}_Loading@w8jt4o`} />
        }
        return (
            <MagicForm ecId={`${this && this.props && this.props.ecId || ''}_MagicForm@jg28ho`} store={formStore}/>
        );
    }
}