refactor: implement blog fetching and pagination in BlogsPage component

This commit is contained in:
hamed
2025-11-19 10:55:26 +03:30
parent 4651ae534d
commit 235a64c378
6 changed files with 106 additions and 31 deletions
+2 -8
View File
@@ -1,16 +1,10 @@
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;
export default function Blogs() {
return (
<Layout name="/blogs">
<BlogsPage blogs={blogs} />
<BlogsPage />
</Layout>
);
}