/**
 * Created at 2018/2/27.
 * @Author Ling.
 * @Email i@zeroling.com
 */
import React, { Component } from 'react';
import { Link, withRouter } from 'react-router';
import './Sidebar.less';

@withRouter
export default class extends Component {
  navList = [
    {
      text: 'ICE 数据大盘',
      to: '/collection',
    },
    {
      text: '所有项目列表',
      to: '/collection/projects',
    },
    {
      text: '我的项目列表',
      to: '/collection/mine',
    },
  ];

  render() {
    const { router } = this.props;
    const currentRoute = router.location.pathname;
    return (
      <div
        className="docs-menu-wrapper collection-sidebar"
        style={styles.wrapper}
      >
        {this.navList.map((item) => {
          return (
            <Link
              key={item.to}
              className={`docs-menu ${
                item.to === currentRoute ? 'active' : ''
              }`}
              to={item.to}
            >
              <div className="docs-menu-item depth-0">
                <span className="docs-menu-item-title">{item.text}</span>
              </div>
            </Link>
          );
        })}
      </div>
    );
  }
}

const styles = {
  wrapper: {
    // width: '250px',
  },
};
