import React from "react";
import { blogs } from "@/utils/data";
import BlogDetailsClient from "./BlogDetailsClient";

export async function generateStaticParams() {
    return blogs.map((blog) => ({
        slug: blog.slug,
    }));
}

export default async function BlogDetailsPage({ params }: { params: Promise<{ slug: string }> }) {
    const { slug } = await params;
    const blog = blogs.find((b) => b.slug === slug);

    return <BlogDetailsClient blog={blog} />;
}
