import React, { Component } from 'react';
import DepartmentManagement from './DepartmentManagement';
import ImportExportNav from './ImportExportNav';
import ResignationList from './ResignationList';

/**
 * 主组件
 */
export default class OrganizationalStructure extends Component {
    constructor(props, context) {
        super(props, context);
        this.state = {
            currentPage: 'DepartmentManagement',
        };
    }

    render() {
        let CurrentContent = DepartmentManagement;
        const variableComponent = this.state.currentPage;

        if (variableComponent === 'ImportExportNav') {
            CurrentContent = ImportExportNav;
        }
        if (variableComponent === 'ResignationList') {
            CurrentContent = ResignationList;
        }
        return (
            <CurrentContent setRoute={(parameter) => {
                this.setState({
                    currentPage: parameter
                }
                );
            }}
            />
        );
    }
}

