--- import { metaData, API_URL } from "../config"; import { Icon } from "astro-icon/components"; import { requireAuthHook } from "@/hooks/requireAuthHook"; import { padlockIconSvg, userIconSvg, externalLinkIconSvg } from "@/utils/navAssets"; import "@/assets/styles/nav.css"; const user = await requireAuthHook(Astro); const isLoggedIn = Boolean(user); const userDisplayName = user?.user ?? null; const navItems = [ { label: "Home", href: "/" }, { label: "Radio", href: "/radio" }, { label: "Memes", href: "/memes" }, { label: "TRip", href: "/TRip", auth: true, icon: "pirate" }, { label: "Lighting", href: "/lighting", auth: true }, { label: "Status", href: "https://status.boatson.boats", icon: "external" }, { label: "Git", href: "https://kode.boatson.boats", icon: "external" }, { label: "Login", href: "/login", guestOnly: true }, ...(isLoggedIn ? [{ label: "Logout", href: "#logout", onclick: "handleLogout()" }] : []), ]; const visibleNavItems = navItems.filter((item) => { if (item.auth && !isLoggedIn) { return false; } if (item.guestOnly && isLoggedIn) { return false; } return true; }); const currentPath = Astro.url.pathname; ---