diff --git a/app/Components/layout/Header/Header.tsx b/app/Components/layout/Header/Header.tsx index fb8c282..8f28717 100644 --- a/app/Components/layout/Header/Header.tsx +++ b/app/Components/layout/Header/Header.tsx @@ -1,11 +1,9 @@ import Image from "next/image"; import Link from "next/link"; -import BarNavigation from "../BarNavigation/BarNavigation"; import header from "./Header.module.css"; -import BarNavigationServicio from "../BarNavigation/BarNavigationServicio"; import { cookies } from "next/headers"; import { jwtVerify } from "jose"; -import { redirect } from "next/navigation"; +import HeaderNavigation from "./HeaderNavigation"; const secret = new TextEncoder().encode(process.env.JWT_SECRET); @@ -44,11 +42,7 @@ export default async function Header() {
- {role === 1 && } - {role === 4 && } - - {role === 2 && } - {role === 3 && } +
); diff --git a/app/Components/layout/Header/HeaderNavigation.tsx b/app/Components/layout/Header/HeaderNavigation.tsx new file mode 100644 index 0000000..2ee35eb --- /dev/null +++ b/app/Components/layout/Header/HeaderNavigation.tsx @@ -0,0 +1,22 @@ +"use client"; + +import { usePathname } from "next/navigation"; +import BarNavigation from "../BarNavigation/BarNavigation"; +import BarNavigationServicio from "../BarNavigation/BarNavigationServicio"; + +export default function HeaderNavigation({ role }: { role: number }) { + const pathname = usePathname(); + + if (pathname === "/") { + return null; + } + + return ( + <> + {role === 1 && } + {role === 4 && } + {role === 2 && } + {role === 3 && } + + ); +} \ No newline at end of file