-
+
{data.title}
-
+
- تاریخ انتشار: {data.date_of_release}
-
-
-
-
- زمان مطالعه: {data.time}
+ {data.author && `نویسنده: ${data.author}`}
+ {createdDate && (
+
+
+ {createdDate}
+
+
+ )}
diff --git a/components/blogs/latestArticles/index.js b/components/blogs/latestArticles/index.js
index 0559dc5..c910eb6 100644
--- a/components/blogs/latestArticles/index.js
+++ b/components/blogs/latestArticles/index.js
@@ -1,20 +1,38 @@
import Article from "./Article";
import Pagination from "@/app/component/Pagination";
-function LatestArticles({ blogs }) {
+function LatestArticles({ blogs, page, totalPages, onPageChange, isLoading }) {
return (
جدیدترین مقاله ها
-
- {blogs.map((item) => (
-
- ))}
-
-
+ {isLoading ? (
+
+ ) : blogs && blogs.length > 0 ? (
+ <>
+
+ {blogs.map((item) => (
+
+ ))}
+
+ {totalPages > 1 && (
+
+ )}
+ >
+ ) : (
+
+ )}
);
}
diff --git a/next.config.js b/next.config.js
index 2a187b8..8a17243 100644
--- a/next.config.js
+++ b/next.config.js
@@ -8,7 +8,17 @@ const nextConfig = {
missingSuspenseWithCSRBailout: false,
},
images: {
- domains: ["back-dev.clinic-pro.ir"],
+ unoptimized: true,
+ remotePatterns: [
+ {
+ protocol: 'https',
+ hostname: 'back-dev.clinic-pro.ir',
+ },
+ {
+ protocol: 'https',
+ hostname: 'clinic-pro-back.ddev.site',
+ },
+ ],
},
env: {
// Make DEV_MODE available to the application
diff --git a/services/response.js b/services/response.js
index ed7575d..1f6e392 100644
--- a/services/response.js
+++ b/services/response.js
@@ -97,4 +97,11 @@ export const request = {
}),
getDoctorAddress: (location_id) =>
api.get(`api/v1/clinic-pro/doctor-address/${location_id}`, removeTokenHead),
+ getBlogs: (params) =>
+ api.get("api/v1/blogs", {
+ params,
+ headers: {
+ Authorization: "",
+ },
+ }),
};