import React, { Component } from 'react';
import PropTypes from 'prop-types';
import DeviceBasicInfoConfig from './DeviceBasicInfoConfig';
import DeviceCapacityInfoConfig from './DeviceCapacityInfoConfig';

/**
 *
 *
 * @class TopoConfigBodyPanel
 * @extends {Component}
 */
class TopoConfigBodyPanel extends Component {
  constructor(props){
    super(props);
    this.state = {

    };
  }
  componentWillMount() {

  }

  componentDidMount(){

  }

  componentWillReceiveProps(nextProps) {

  }

  componentWillUnmount() {

  }

  getTopoContentPanelByType = () => {
    let { selectedKey } = this.props;
    let content = [];
    if (selectedKey === 1) {
      content.push(<DeviceBasicInfoConfig {...this.props} />);
    } else if (selectedKey === 2)
    {
      content.push(<DeviceCapacityInfoConfig {...this.props} />);
    }
    return content;
  }

  render() {
    return (
      <div className='topo-config-panel-content-root'>
        {this.getTopoContentPanelByType()}
      </div>
    );
  }
}

TopoConfigBodyPanel.propTypes = {
  selectedKey: PropTypes.number,
  getImgPath: PropTypes.func
};

export default TopoConfigBodyPanel;
