import {
	observer
} from 'mobx-react';
import {
	WeaDialog,
} from 'ecCom';
import {
	Loading,
} from '../../public/learn';
// import Browser from './Browser';
import DialogForm from './DialogForm';

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

	render() {
		const {
			store
		} = this.props, {
			DIALOG,
			dialog,
			tab,
			dialogStyle,
		} = store, {
			selectedKey
		} = tab;

		let c;
		if (dialog.loading) {
			c = <Loading ecId={`${this && this.props && this.props.ecId || ''}_Loading@9jfdh2`} />;
		} else {
			if (selectedKey === '1') {
				// c = <Browser store={store}/>;
			} else {
				c = <DialogForm ecId={`${this && this.props && this.props.ecId || ''}_DialogForm@eoob09`} store={store}/>;
			}
		}


		return (
			<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@obyepq`}
				{...DIALOG}
				{...dialog}
				style={dialogStyle}
			>
				{c}
			</WeaDialog>
		);
	}
}