import { prisma } from "@/lib/prisma"; import { notFound } from "next/navigation"; import { format } from "date-fns"; import Link from "next/link"; import { ChevronLeft, Calendar, Clock, Tag as TagIcon, Share2 } from "lucide-react"; export default async function BlogDetailPage({ params }: { params: Promise<{ slug: string }> }) { const { slug } = await params; const blog = await prisma.blog.findUnique({ where: { slug }, include: { tags: true }, }); if (!blog || blog.status !== "PUBLISHED") { notFound(); } return (
{/* Decorative Background Elements */}
Back to all posts
{blog.publishedAt ? format(new Date(blog.publishedAt), "MMMM dd, yyyy") : "Published"}
6 min read

{blog.title}

{blog.tags.map((tag) => ( {tag.name} ))}
{/* Content Section */}
{/* Using a simple div for content here. In a real app we'd use a markdown renderer like react-markdown */}
{blog.content}
{/* Author Footer */}

Written by Fikri

Fullstack engineer passionate about building beautiful, functional, and user-centric web applications.

); }