"use client"; import { useState } from "react"; import { Link, useTranslation } from "@/i18n/navigation"; import { TOPIC_IDS } from "@/config"; import type { ResourceData } from "@/app/lib/theme-data"; 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 linkHrefs: Record = { destinations: { href: "https://meetup.hackrobot.cn/", newTab: true }, vipEntry: { href: "https://vip.hackrobot.cn/", newTab: true }, appDownload: { href: "/app" }, }; type CommunityProps = { resourceData?: ResourceData; }; export default function Community({ resourceData }: CommunityProps) { const { t } = useTranslation("community"); const [toast, setToast] = useState(false); const showUpdating = () => { setToast(true); setTimeout(() => setToast(false), 2000); }; const renderCardContent = (key: string) => ( <> {linkIcons[key]}

{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) => ( ))}
{/* 更新中 Toast */} {toast && (
{t("updating")}
)}
); }