"use client"; import { Box, Divider, Stack, Button } from "@mui/material"; import NymLogo from "../../components/icons/NymLogo"; import { Link } from "../../components/muiLink"; import { Wrapper } from "../../components/wrapper"; import ConnectWallet from "../wallet/ConnectWallet"; import { DarkLightSwitchDesktop } from "./Switch"; import MENU_DATA from "./menuItems"; import { EnvironmentSwitcher } from "./EnvironmentSwitcher"; import { usePathname } from "next/navigation"; import { getBasePathByEnv } from "../../../envs/config"; import { useEnvironment } from "@/providers/EnvironmentProvider"; import { Circle } from "@mui/icons-material"; export const DesktopHeader = () => { const pathname = usePathname(); const { environment } = useEnvironment(); const basePath = getBasePathByEnv(environment || "mainnet"); const explorerName = environment ? `${environment} Explorer` : "Mainnet Explorer"; // Helper function to determine if a tab is active const isTabActive = (tabTitle: string) => { // Check if the current pathname matches the tab title // For explorerName, check if we're on the base path if (tabTitle === explorerName) { return pathname === basePath || pathname === basePath + "/"; } // For menu items, check if the pathname includes the menu URL const menuItem = MENU_DATA.find((menu) => menu.title === tabTitle); if (menuItem) { return pathname.includes(menuItem.url); } return false; }; return ( {MENU_DATA.map((menu) => ( ))} ); };