import React from "react";
import { Link, withRouter } from "react-router-dom";
import { connect } from "react-redux";
import "./adminHeader.scss";
import { adminMenu } from "../../state/adminMenu";

const adminHeader = props => {

	return (
		<header className="header" id="header">
			<div className="header__left-wrapper">
				<div className="header__logo-box">logo</div>
				<nav className="header__nav">
					<ul className="header__list">
						{adminMenu.map(el =>
							el.hideWhenAuth && props.user ? null : (
								<li className="header__item" key={el.id}>
									<Link to={el.path}>{el.text}</Link>
								</li>
							)
						)}
					</ul>
				</nav>
			</div>
		</header>
	);
};

const mapStateToProps = state => ({
});

export default connect(mapStateToProps)(withRouter(adminHeader));