import React from 'react';
import {
	inject,
	observer,
} from 'mobx-react';
import {
	WeaAuth
} from 'ecCom';
import {
	Spin
} from 'antd';
import {
	toJS
} from 'mobx';

@inject('hrmStaffCareReminder')
@observer
export default class AuthForm extends React.Component {
	constructor(props) {
		super(props);
	}

	render() {
		const {
			hrmStaffCareReminder
		} = this.props, {
			authForm,
			dialogStaticProps,
			dialogTitle,
		} = hrmStaffCareReminder, {
			loading,
			conditions,
		} = authForm;

		if (loading) {
			return (
				<div className='hrm-loading-center-small'>
                    <Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@u6upqc`} spinning={loading}></Spin>
                </div>
			)
		} else {
			return (
				<WeaAuth ecId={`${this && this.props && this.props.ecId || ''}_WeaAuth@w2gfat`} {...authForm} title={dialogTitle} conditions={toJS(conditions)} {...dialogStaticProps}/>
			)
		}
	}
}