import React from 'react';
import { Icon, Modal, message, Spin, Button, Tabs } from 'antd';
import './userList.less';
import OrgCertify from './orgCertify.jsx';

const OrgDesc = React.createClass({
    getInitialState() {
        return {
            visible: false,
            loading: false
        };
    },
    showModal() {
        this.setState({
            visible: true,
        });
    },
    handleCancel(e) {
        this.setState({
            visible: false,
        });
        this.props.closeDesc(false);
    },
    handleOk(e) {
        this.setState({
            visible: false,
        });
        this.props.closeDesc(false,true);
    },
    componentWillReceiveProps(nextProps) {
        this.state.visible = nextProps.showDesc;
    },
    render() {
        if (this.props.data) {
            return (
                <div className="patent-desc">
                    <Spin spinning={this.state.loading} className='spin-box'>
                        <Modal title="用户详情" visible={this.state.visible}
                            onCancel={this.handleCancel}
                            width='600px'
                            footer=''
                            className="admin-desc-content">
                            <OrgCertify
                                visible={this.state.visible}
                                uid={this.props.data.id}
                                closeDesc={this.handleCancel}
                                handleOk={this.handleOk} />
                        </Modal>
                    </Spin>
                </div>
            );
        } else {
            return <div></div>
        }
    },
});

export default OrgDesc;