import React, { Component } from 'react';
import '../content.less';
import LeftTab from './leftTab.jsx';
import UserList from './userList.jsx';
import OrgList from './orgList.jsx';

class Content extends Component {
    constructor() {
        super();
        this.state = {
            loading: false,
            leftKey: 'orgList',
        };
    }

    getKey(key) {
        this.setState({
            leftKey: key,
        });
    }
    render() {
        return (
            <div className="manage-content">
                <LeftTab handlekey={this.getKey.bind(this)} />
                <div className="content-right">
                    {(() => {
                        switch (this.state.leftKey) {
                            case 'userList':
                                return <UserList />;
                            case 'orgList':
                                return <OrgList />;
                        };
                    })()}
                </div>
            </div>
        )
    }
}

export default Content;
