import React from 'react';
import { Link } from 'react-router-dom';

/**
 * nav:{list:[],active:0} */ 
export default(({ header , nav })=>{
  return(
    <ul className="list-l-Menu">
      {header}
      {
        nav && nav.list && nav.list.length>0 ?
          nav.list.map((item,key)=>{
            return(
              <li key={key} className={nav.active === key?"active":''}>
                <p>
                  <Link to={item.href}>
                    <i className={`iconfont ${item.icon || 'icon-huabanfuben'} font-18 mr10`}></i>{item.name}
                  </Link>
                </p>
              </li>
            )
          })
        :""
      }
    </ul>
  )
})