Rev 6711 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
import React, { useState } from 'react'
import LinkItem from './link-item/LinkItem'
import SearchInput from './searchbox/SearchInput'
import ResponsiveNavbar from './responsive-navbar/ResponsiveNavbar'
import UserImageDropdown from './user-dropdown/UserImageDropdown'
import './styles/main.scss'
const Header = ({
logo,
menu,
image,
name,
country,
description,
visits,
connections,
linkAdmin,
linkImpersonate,
}) => {
const [isShow, setIsShow] = useState(false)
const toggleMenu = () => {
setIsShow((prevIsShow) => !prevIsShow)
}
const closeMenu = () => {
setIsShow(false)
}
return (
<>
<header className="main-header">
<a href="/" className="logo">
<img src={logo} alt="Company logo" />
</a>
<SearchInput />
<div className="hamburgerIcon d-xl-none">
<i className="fa fa-bars text-gray" onClick={toggleMenu} />
</div>
<nav className="header-navigation">
<ul>
{menu?.map((item, index) => (
<li key={index}>
<LinkItem {...item} />
</li>
))}
</ul>
</nav>
<UserImageDropdown
image={image}
fullName={name}
linkAdmin={linkAdmin}
linkImpersonate={linkImpersonate}
/>
</header>
<ResponsiveNavbar
show={isShow}
toggleMenu={closeMenu}
name={name}
image={image}
visits={visits}
country={country}
description={description}
connections={connections}
linkAdmin={linkAdmin}
linkImpersonate={linkImpersonate}
/>
</>
)
}
export default Header