import Link from "next/link"; import { prisma } from "@/lib/prisma"; export const dynamic = "force-dynamic"; export default async function AdminArticles() { // .catch(() => []) keeps the precise selected-row type while falling back to // an empty list when the DB is unavailable (instead of a 500). const articles = await prisma.websiteArticles .findMany({ orderBy: { createdAt: "desc" }, select: { id: true, title: true, slug: true, createdAt: true }, take: 50, }) .catch(() => []); return (

Articles

+ New article
{articles.map((a) => ( ))}
Title Slug Created
{a.title} {a.slug} {a.createdAt ? a.createdAt.toISOString().slice(0, 10) : ""}
); }