import React from 'react';
import './Index.scss';
// import gitlink from './Img/gitlink.png';
import { getImageUrl } from 'educoder';

function HeadNav({showLoginDialog,mygetHelmetapi}) {
  const register = mygetHelmetapi && mygetHelmetapi.common && mygetHelmetapi.common.register;
  const navbar = mygetHelmetapi && mygetHelmetapi.navbar;
  return(
    <div className="headNav">
      <div className="headNavDiv">
        <ul className="headlist">
          <li><img src={getImageUrl(`/${mygetHelmetapi && mygetHelmetapi.nav_logo_url}`)} alt="gitlink" height="37px" style={{marginRight:"15px"}}/></li>
          {
            navbar && navbar.length>0&&
            navbar.map((i,k)=>{
              return(
                <li style={{display:i.hidden?"none":"block"}}><a href={i.link}>{i.name}</a></li>
              )
            })
          }
        </ul>
        <div>
          <a className="color-white" onClick={showLoginDialog}>登录</a>
          <a className="regBtn" href={register}>注册</a>
        </div>
      </div>
    </div>
  )
}
export default HeadNav;