"use client"; import { Link, useTranslation } from "@/app/digital/i18n/navigation"; import type { ResourceData } from "@/app/digital/lib/theme-data"; import { useCrossSiteUrls } from "@/app/digital/lib/useCrossSiteUrls"; import DigitalThemeIcon, { type IconName } from "./DigitalThemeIcon"; import ResourceNavigation from "./ResourceNavigation"; const mainModuleKeys = ["destinations", "vipEntry", "appDownload"] as const; const topicKeys = ["indieDev", "aiAgent", "cloudPhone", "unmannedLive"] as const; const linkIcons: Record = { destinations: "🗺️", vipEntry: "👑", appDownload: "📱", indieDev: "🛠️", aiAgent: "🤖", cloudPhone: "☁️", unmannedLive: "📺", }; const linkIconNames: Record = { destinations: "map", vipEntry: "spark", appDownload: "phone", indieDev: "tool", aiAgent: "spark", cloudPhone: "cloud", unmannedLive: "video", }; const topicHrefs: Record<(typeof topicKeys)[number], string> = { indieDev: "/ebook", aiAgent: "/#tools", cloudPhone: "/ebook", unmannedLive: "/ebook", }; type CommunityProps = { resourceData?: ResourceData; }; export default function Community({ resourceData }: CommunityProps) { const { t } = useTranslation("community"); const { meetupUrl, vipUrl } = useCrossSiteUrls(); const linkHrefs: Record = { destinations: { href: meetupUrl, newTab: true }, vipEntry: { href: vipUrl, newTab: true }, appDownload: { href: "/app" }, }; const renderCardContent = (key: string) => ( <>

{t(`links.${key}.title`)}

{t(`links.${key}.desc`)}

{t(`links.${key}.label`)}
); return (

{t("resourcesTitle")}

{t("contributeSubtitle")}
{t("contributeSubtitle2")}

{/* 图书 / 商业数码 / 网盘 */} {resourceData && } {/* 目的地数据库 + 私域VIP入口 + App 下载 - 主模块 */}
{mainModuleKeys.map((key) => { const { href, newTab } = linkHrefs[key]; return ( {renderCardContent(key)} ); })}
{/* 4 个专题 */}

{t("topicTag")}

{topicKeys.map((key) => (

{t(`links.${key}.title`)}

{t(`links.${key}.desc`)}

{t(`links.${key}.label`)}
))}
); }