"use client";
import Image from "next/image";
import header from "../app/styles/layout/header.module.scss";
import Link from "next/link";
import BarNavigation from "./BarNavigation";
import BarNavigationAdmin from "./BarNavigationAdmin";
import { usePathname } from "next/navigation";

function Header() {
  const pathname = usePathname();

  const publicNav = [
    "/escaner",
    "/agregarEquipo",
    "/editar",
    "/cambiarPass",
    "/historial",
    "/ranking",
  ];
  
  const privateNav = ["/equipoComputo", "/crearCuenta", "/perifericos","/reportesGraficas"];

  return (
    <header className={header.header}>
      <Link
        href="https://www.unam.mx/"
        target="_blank"
        className={header.center}
        style={{
          display: "flex",
          alignItems: "center",
        }}
      >
        <div className={header.logoContainer}>
          <Image
            className={header.logo}
            src="/logo-blanco.png"
            alt="Logo FES"
            fill
            style={{ objectFit: "contain" }}
          />
        </div>
      </Link>
      <div className={header.yellowPart}></div>
      <div className={header.containerBarNav}>
        {publicNav.includes(pathname) && <BarNavigation />}
        {privateNav.includes(pathname) && <BarNavigationAdmin />}
      </div>
    </header>
  );
}

export default Header;
//IO
