"use client"; import { navigations as orgNavigations } from "@/app/(introduce)/organization/(generally)/config"; import { navigations as achieveNavigations } from "@/app/(introduce)/achievements-transformation/config"; import { navigations as talentsNavigations } from "@/app/(introduce)/talents/config"; import { navigations as academyNavigations } from "@/app/(articles)/academic-exchange/academic-events/pages/[pageIndex]/config"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { useState } from "react"; const navigations = [ { title: "首页", href: "/" }, { title: "机构设置", href: "/organization/overview", children: orgNavigations, }, { title: "人才队伍", href: "/talents/overview", children: talentsNavigations, }, { title: "科研进展", href: "/research-progress/pages/1" }, { title: "科技成果", href: "/technological-achievements/pages/1" }, { title: "学术交流", href: "/academic-exchange/academic-events/pages/1", children: academyNavigations, }, { title: "成果转化服务", href: "/achievements-transformation/government-policy", children: achieveNavigations, }, { title: "中科院科技资源共享平台", href: "https://casshare.com/experts/index.jsp", target: "_blank", }, { title: "联系我们", href: "/contact-us" }, ]; const isActive = (link: string, current: string): boolean => { if (link === current) return true; if (link === "/") return false; const link_0 = link.split(/\/+/).filter(Boolean)[0]; const current_0 = current.split(/\/+/).filter(Boolean)[0]; return link_0 === current_0; }; const MainNav = () => { const pathname = usePathname(); const [activePopup, setActivePopup] = useState(-1); return ( ); }; export default MainNav;