"use client"; import { Link as I18nLink, usePathname, useRouter } from "@/i18n/routing"; import { cn } from "@/lib/utils"; import { HeaderLink } from "@/types/common"; import { ExternalLink } from "lucide-react"; import { useTranslations } from "next-intl"; const HeaderLinks = () => { const tHeader = useTranslations("Header"); const pathname = usePathname(); const router = useRouter(); const headerLinks: HeaderLink[] = tHeader.raw("links"); const localePrefix = `/${(pathname || "/zh").split("/")[1] || "zh"}`; return (
{headerLinks.map((link) => { const isAbout = link.href === "/about"; const isNews = link.href === "/blog"; if (isAbout) { return (
{link.name} {/* 移除触发器与菜单间的间隙,使用 pt-2 保持视觉间距但不中断 hover 区域 */}
友发愿景 产品体系 应用场景 联系方式
); } if (isNews) { return (
{link.name}
{[ { key: "company", label: "公司新闻" }, { key: "experts", label: "专家访谈" }, { key: "industry", label: "行业动态" }, { key: "notice", label: "公告" }, ].map((it) => ( ))}
); } return ( {link.name} {link.target && link.target === "_blank" && ( )} ); })}
); }; export default HeaderLinks;