export const dynamic = "force-dynamic"; // This disables SSG and ISR import prisma from "@/lib/prisma"; import Link from "next/link"; export default async function Home() { const posts = await prisma.post.findMany({ orderBy: { createdAt: "desc", }, take: 6, include: { author: { select: { name: true, }, }, }, }); return (
by {post.author ? post.author.name : "Anonymous"}
{new Date(post.createdAt).toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric", })}
{post.content || "No content available."}