import Link from "next/link"; import { ArrowUpRight, Sparkles } from "lucide-react"; import type { ReactNode } from "react"; type NavLinkItem = { id: string; name: string; url: string; }; type StatItem = { label: string; value: string; }; const mainTabs = [ { key: "home", label: "首页", href: "/lovart" }, { key: "pricing", label: "定价", href: "/lovart/pricing" }, { key: "news", label: "新闻", href: "/lovart/news" }, { key: "blog", label: "博客", href: "/lovart/blog" }, { key: "changelog", label: "更新日志", href: "/lovart/changelog" }, ] as const; const socialLinks = [ { label: "Discord", href: "https://discord.com/invite/3Fr4KPrwbA" }, { label: "X", href: "https://twitter.com/lovart_ai" }, { label: "YouTube", href: "https://www.youtube.com/@lovart_ai" }, { label: "LinkedIn", href: "https://www.linkedin.com/company/lovart-ai" }, { label: "Instagram", href: "https://www.instagram.com/lovart.ai" }, { label: "TikTok", href: "https://www.tiktok.com/@lovart_ai" }, ]; function resolveDocsLink(navLinks: NavLinkItem[], keywords: string[]) { const loweredKeywords = keywords.map((keyword) => keyword.toLowerCase()); return ( navLinks.find((link) => loweredKeywords.some((keyword) => link.name.toLowerCase().includes(keyword)) )?.url ?? null ); } function isExternal(url: string) { return /^https?:\/\//i.test(url); } export function MarketingShell({ siteName, siteLogo, navLinks, active, bannerText, stats, children, }: { siteName: string; siteLogo?: string | null; navLinks: NavLinkItem[]; active: "home" | "pricing" | "news" | "blog" | "changelog"; bannerText?: string | null; stats?: StatItem[]; children: ReactNode; }) { const docsUrl = resolveDocsLink(navLinks, ["文档", "docs"]); const blogUrl = resolveDocsLink(navLinks, ["博客", "blog"]) || "/lovart/blog"; const changelogUrl = resolveDocsLink(navLinks, ["更新", "changelog", "release"]) || "/lovart/changelog"; return (