import Link from "next/link"; import { prisma } from "@/lib/db"; import { Button } from "@/components/ui/button"; import { AddonCard } from "@/components/public/AddonCard"; import { HeroBanner } from "@/components/public/HeroBanner"; import { GameGallery } from "@/components/public/GameGallery"; import { Sparkles, Shield, Zap, Calendar } from "lucide-react"; export const dynamic = "force-dynamic"; export default async function HomePage() { const [featuredAddons, launcher, launcherDownloads, banners, galleryImages, latestArticles] = await Promise.all([ prisma.addon.findMany({ where: { published: true }, include: { releases: { where: { isLatest: true }, select: { version: true }, }, }, orderBy: { totalDownloads: "desc" }, take: 6, }), prisma.software.findUnique({ where: { slug: "nanami-launcher" }, include: { versions: { where: { isLatest: true }, take: 1, }, }, }), prisma.softwareVersion.aggregate({ where: { software: { slug: "nanami-launcher" } }, _sum: { downloadCount: true }, }), prisma.bannerImage.findMany({ where: { enabled: true }, orderBy: { sortOrder: "asc" }, select: { imageUrl: true }, }), prisma.galleryImage.findMany({ where: { enabled: true }, orderBy: { sortOrder: "asc" }, select: { imageUrl: true, title: true }, }), prisma.article.findMany({ where: { published: true }, orderBy: { createdAt: "desc" }, take: 3, }), ]); const launcherVersion = launcher?.versions[0]?.version ?? null; const totalDownloads = launcherDownloads._sum.downloadCount ?? 0; return ( <> {/* Features */} 深度适配 专为乌龟服 1.18.0 打造,兼容自定义内容与新种族,稳定流畅 一键安装管理 通过 Nanami 启动器自动安装、更新,告别手动拖拽文件夹 内置 AI 翻译 自带智能翻译引擎,轻松畅玩英文服务器,语言不再是障碍 {/* Latest Articles */} {latestArticles.length > 0 && ( 最新公告 } > 查看更多 {latestArticles.map((article) => ( {article.coverImage && ( )} {article.title} {article.summary && ( {article.summary} )} {new Date(article.createdAt).toLocaleDateString("zh-CN")} ))} )} {/* Featured Addons */} {featuredAddons.length > 0 && ( 热门插件 } > 查看全部 {featuredAddons.map((addon) => ( ))} )} > ); }
专为乌龟服 1.18.0 打造,兼容自定义内容与新种族,稳定流畅
通过 Nanami 启动器自动安装、更新,告别手动拖拽文件夹
自带智能翻译引擎,轻松畅玩英文服务器,语言不再是障碍
{article.summary}