+ {articles.map((item) => (
+
+ {/* Image + Category */}
+
+
+
+ {item.categories[0]?.title || categoryLabel}
+
+
+
+ {/* Content */}
+
+
+ {item.title}
+
+
+ BY{" "}
+
+ {item.createdByName || "Admin"}
+ {" "}
+ • {new Date(item.createdAt).toLocaleDateString("id-ID")}
+
+
+ {truncateText(item.description, 20)}
+
+
+
+
+ ))}
+
+ {/* Pagination */}
+
+ {Array.from({ length: totalPage }, (_, i) => (
+
+ ))}
+
+
+ {/* Advertisement */}
+
+
+
+
+ {/* Connect with us */}
+
+
+ {/* Tabs */}
+
+
+ {["trending", "comments", "latest"].map((tab) => (
+
+ ))}
+
+
+
+ {articles.map((item) => (
+
+
+
+
{item.title}
+
+ {new Date(item.createdAt).toLocaleDateString()}
+
+
+
+ ))}
+
+
+
+ Recommended
+
+
+
+
+
+
+
+ {articles[0]?.title}
+
+
+ {" "}
+ {new Date(articles[0]?.createdAt).toLocaleDateString(
+ "id-ID",
+ {
+ day: "numeric",
+ month: "long",
+ year: "numeric",
+ }
+ )}
+
+
+
+
+
+ {articles?.slice(1, 4).map((article, index) => (
+
+
+
+
+
+
+ {article?.title}
+
+
+ {" "}
+ {new Date(articles[0]?.createdAt).toLocaleDateString(
+ "id-ID",
+ {
+ day: "numeric",
+ month: "long",
+ year: "numeric",
+ }
+ )}
+
+
+
+ ))}
+
+
+
+
+