Files
front-AT/app/Components/layout/Header/Header.tsx
T

53 lines
1.4 KiB
TypeScript
Raw Normal View History

2025-10-29 14:28:50 -06:00
"use client";
2025-09-02 19:50:17 -04:00
import Image from "next/image";
2025-09-28 01:59:16 -06:00
import header from "./Header.module.css";
2025-09-02 19:50:17 -04:00
import Link from "next/link";
2025-10-29 14:28:50 -06:00
import BarNavigation from "../BarNavigation/BarNavigation";
2025-12-08 18:02:33 -06:00
import { useEffect, useState } from "react";
2025-09-02 19:50:17 -04:00
function Header() {
2025-12-08 18:02:33 -06:00
const [role, setRole] = useState("");
useEffect(() => {
const cookies = Object.fromEntries(
document.cookie.split("; ").map((c) => c.split("="))
);
setRole(cookies.role || "");
}, []);
2025-10-29 14:28:50 -06:00
2025-09-28 01:59:16 -06:00
return (
2025-12-08 18:02:33 -06:00
<header className={header.header}>
2025-09-28 01:59:16 -06:00
<Link
href="https://www.unam.mx/"
target="_blank"
className={header.center}
2025-10-29 14:28:50 -06:00
style={{
display: "flex",
2025-12-08 18:02:33 -06:00
alignItems: "center",
margin: "10px 5px",
2025-10-29 14:28:50 -06:00
}}
>
2025-12-08 18:02:33 -06:00
<div className={header.logoContainer}>
<Image
className={header.logo}
src="/logo_fes.png"
alt="Logo FES"
fill
style={{ objectFit: "contain" }}
/>
</div>
</Link>
<div className={header.yellowPart}></div>
<div className={header.containerBarNav}>
{role === "ADMINISTRADOR" && <BarNavigation />}
2026-01-12 13:57:08 -06:00
{role === "SUPER ADMINISTRADOR (quita sanciones)" && <BarNavigation />}
{role === "SERVICIO SOCIAL" && <BarNavigation/>}
{role === "ATENCION A USUARIO" && <BarNavigation/>}
2025-09-28 01:59:16 -06:00
</div>
</header>
);
2025-09-02 19:50:17 -04:00
}
export default Header;
2025-09-28 01:59:16 -06:00
//IO