import { prisma } from "@/lib/db"; import { signCoverUrls } from "@/lib/r2"; import { MangaGrid } from "@/components/MangaGrid"; import type { Metadata } from "next"; export const metadata: Metadata = { title: "Search", }; type Props = { searchParams: Promise<{ q?: string }>; }; export default async function SearchPage({ searchParams }: Props) { const { q } = await searchParams; const manga = q ? await prisma.manga.findMany({ where: { status: "PUBLISHED", title: { contains: q, mode: "insensitive" }, }, orderBy: { title: "asc" }, include: { _count: { select: { chapters: true } } }, }) : []; const signedManga = await signCoverUrls(manga); return (
Use the search bar above to find manga
)}