import BlogsPage from "@/components/blogs";
import Layout from "@/components/layout/StLayout";
import { fetchReq } from "@/lib/req";

export default async function Blogs() {
  const API_URL = process.env.NEXT_PUBLIC_API_URL;

  const response = await fetchReq(`${API_URL}/api/v1/blogs`);
  const blogs = response.blogs;

  return (
    <Layout name="/blogs">
      <BlogsPage blogs={blogs} />
    </Layout>
  );
}
