import {
    inject,
    observer
} from 'mobx-react'
import {
    WeaDialog,
} from 'ecCom'
import { toJS } from "mobx";
import { Button } from "antd";

@inject('intelogin')
@observer
export default class ErrorDialog extends React.Component {
    constructor(props) {
        super(props);
        this.state = {}
    }

    render() {
        const {intelogin} = this.props;
        const {showErrorDialog,errorMessage} = toJS(intelogin.status);

        let buttons = [
            <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@qxrkyb@integrationLoginErrorDialogButtonSubmit`} type="primary"  onClick={() => intelogin.setState({ showErrorDialog: false })}>确定</Button>,
        ];
        return (
            <div>
            <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@5vx4w8`}
                title={"集成登录失败"}
                icon='icon-coms-Edition'
                iconBgcolor="#FF9900"
                visible={showErrorDialog}
                hasScroll={true}
                style={{width: 400, height: 120}}
                onCancel={() => {
                    intelogin.setState({showErrorDialog : false});
                }}
                buttons={buttons}
            >
                <div style={{top: '40%',width:'100%',padding:'0 10px',textAlign: 'center',position:'relative',marginTop:-8,fontSize:14}}>
                    <p><span style={{wordBreak:'break-all'}}>{errorMessage}</span></p>
                </div>
            </WeaDialog>
            </div>
        )
    }
}