import BlogPage from "@/components/blog";
import Layout from "@/components/layout/StLayout";
import { fetchReq } from "@/lib/req";

async function Blog({ params: { slug } }) {
  const blog = await fetchReq(
    `https://back-dev.clinic-pro.ir/api/v1/blog/${slug}`
  );
  const blogs = await fetchReq("https://back-dev.clinic-pro.ir/api/v1/blogs");

  return (
    <Layout>
      <BlogPage blog={blog} blogs={blogs.blogs} />
    </Layout>
  );
}

export default Blog;
