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);
    },
    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='800px'
                            footer={[]}
                            className="admin-desc-content">
                            <Tabs defaultActiveKey="1">
                                <Tabs.TabPane tab="认证资料" key="1">
                                    <OrgCertify uid={this.props.data.id} closeDesc={this.handleCancel} />
                                </Tabs.TabPane>
                                <Tabs.TabPane tab="Tab 2" key="2">Content of Tab Pane 2</Tabs.TabPane>
                                <Tabs.TabPane tab="Tab 3" key="3">Content of Tab Pane 3</Tabs.TabPane>
                            </Tabs>
                        </Modal>
                    </Spin>
                </div>
            );
        } else {
            return <div></div>
        }
    },
});

export default OrgDesc;