/**
 * 录制记录列表
 */
import React, { Component } from "react";
import { connect } from "dva";
import { Layout, Menu } from "antd";
import { Link, Route, Redirect, Switch } from "dva/router";
import styles from "./header.less";
import { CommandRouter } from "../Router";
const { Header, Footer, Sider, Content } = Layout;
@connect((state) => ({}))
export default class HeaderMenu extends Component {
  constructor(props) {
    super(props);
    this.state = {
      currentGroup: 0,
    };
  }
  componentDidMount() {}
  componentWillReceiveProps(nextProps) {
  }
  render() {
    return (
      <Header className={styles.header}>
        {/* <div className="logo" /> */}
        <div className={styles.logo}>
          <h1>指挥调度系统</h1>
        </div>
        <div className={styles.commandMenu}>
          {CommandRouter.map((item, index) => {
            return (
              <a
                onClick={() => {
                  this.props.currentRouter(item);
                  this.setState({
                    currentGroup: index,
                  });
                }}
                className={
                  this.state.currentGroup === index ? styles.selected : ""
                }
              >
                {item.name}
              </a>
            );
          })}
        </div>
      </Header>
    );
  }
}
