29 lines
766 B
TypeScript
29 lines
766 B
TypeScript
import { prisma } from "@/lib/db";
|
|
import { signCoverUrls } from "@/lib/r2";
|
|
import { collectGenres } from "@/lib/genres";
|
|
import { GenreTabs } from "@/components/GenreTabs";
|
|
import type { Metadata } from "next";
|
|
|
|
export const dynamic = "force-dynamic";
|
|
|
|
export const metadata: Metadata = {
|
|
title: "Genres",
|
|
};
|
|
|
|
export default async function GenrePage() {
|
|
const manga = await prisma.manga.findMany({
|
|
where: { status: "PUBLISHED" },
|
|
orderBy: { title: "asc" },
|
|
include: { _count: { select: { chapters: true } } },
|
|
});
|
|
|
|
const signedManga = await signCoverUrls(manga);
|
|
const genres = collectGenres(signedManga);
|
|
|
|
return (
|
|
<div className="max-w-6xl mx-auto px-4 py-5">
|
|
<GenreTabs manga={signedManga} genres={genres} />
|
|
</div>
|
|
);
|
|
}
|