{visibleNavItems.map((item) => {
const isExternal = item.href?.startsWith("http");
const isAuthedPath = item.auth ?? false;
const normalize = (url) => (url || '/').replace(/\/+$/, '') || '/';
const normalizedCurrent = normalize(currentPath);
const normalizedHref = normalize(item.href);
const isActive = !isExternal && (
normalizedHref === '/'
? normalizedCurrent === '/'
: normalizedCurrent === normalizedHref || normalizedCurrent.startsWith(normalizedHref + '/')
);
return (
-
{item.label}
{item.icon === "external" && (
)}
{item.icon === "padlock" && (
)}
{item.icon === "pirate" && (
🏴☠️
)}
);
})}
{isLoggedIn && userDisplayName && (
{userDisplayName}
)}