import { Menu } from "lucide-react"; import { Link, useLocation } from "react-router-dom"; import { navigationTools, type NavigationToolSlug } from "@/constant/navigation-tools"; import { AppConfigModal } from "@/components/layout/app-config-modal"; import { MobileNavDrawer } from "@/components/layout/mobile-nav-drawer"; import { UserStatusActions } from "@/components/layout/user-status-actions"; import { cn } from "@/lib/utils"; import { useState } from "react"; export function AppTopNav() { const { pathname } = useLocation(); const [mobileNavOpen, setMobileNavOpen] = useState(false); const hideHeader = /^\/canvas\/[^/]+/.test(pathname); const slug = pathname.split("/").filter(Boolean)[0]; const activeToolSlug = navigationTools.some((tool) => tool.slug === slug) ? (slug as NavigationToolSlug) : undefined; return ( <> {!hideHeader ? (
无限画布
) : null} setMobileNavOpen(false)} /> ); }