sunnymh/app/page.tsx
yiekheng 4f5d74e1c8 Squashed 'manga-site/' content from commit f2ef775
git-subtree-dir: manga-site
git-subtree-split: f2ef775f7095dc2b107b576cd4053593e89dd887
2026-04-12 18:47:51 +08:00

33 lines
1000 B
TypeScript

import { prisma } from "@/lib/db";
import { signCoverUrls } from "@/lib/r2";
import { collectGenres } from "@/lib/genres";
import { TrendingCarousel } from "@/components/TrendingCarousel";
import { GenreTabs } from "@/components/GenreTabs";
export const dynamic = "force-dynamic";
export default async function Home() {
const manga = await prisma.manga.findMany({
where: { status: "PUBLISHED" },
orderBy: { updatedAt: "desc" },
include: { _count: { select: { chapters: true } } },
});
const signedManga = await signCoverUrls(manga);
// Top 10 for trending
const trending = signedManga.slice(0, 10);
const genres = collectGenres(signedManga);
return (
<div className="max-w-6xl mx-auto px-4 py-5 space-y-8">
{/* Trending section — Webtoon-style ranked carousel */}
<TrendingCarousel manga={trending} />
{/* Genre browsing section — horizontal tabs + filtered grid */}
<GenreTabs manga={signedManga} genres={genres} />
</div>
);
}