-
-
+ {/* RIGHT SIDE – RECENT POSTS */}
+
+
Recent Posts
+
+
+ {recentPosts.map((item) => (
+
+
-
-
- {item.categoryName}
-
-
+
+
+
{item.title}
-
-
-
- {item.createdByName}{" "}
-
-
-
-
-
- {new Date(item.createdAt).toLocaleDateString("en-GB", {
- day: "2-digit",
- month: "long",
- year: "numeric",
- })}
-
-
+
+
+ {new Date(item.publishedAt).toLocaleDateString("id-ID", {
+ day: "2-digit",
+ month: "long",
+ year: "numeric",
+ })}
+
-
- ))}
+ ))}
+
+
+ {/* LOAD MORE */}
+
+
+ {/* KOLOM PPS BOTTOM BANNER */}
+
+
+
);
}
diff --git a/components/landing-page/headers-latest.tsx b/components/landing-page/headers-latest.tsx
index 4d98462..a9b69a7 100644
--- a/components/landing-page/headers-latest.tsx
+++ b/components/landing-page/headers-latest.tsx
@@ -96,7 +96,7 @@ export default function HeaderLatest() {
height={400}
className="w-full h-[250px] object-cover rounded-md"
/>
-
+
{article.categories?.[0]?.title ||
article.categoryName ||
"BERITA"}
@@ -115,7 +115,7 @@ export default function HeaderLatest() {
READ MORE >
@@ -131,7 +131,7 @@ export default function HeaderLatest() {
onClick={() => setPage(i + 1)}
className={`w-9 h-9 rounded-full border border-gray-300 text-sm ${
page === i + 1
- ? "bg-yellow-400 text-white font-bold"
+ ? "bg-blue-400 text-white font-bold"
: "text-gray-700 hover:bg-gray-200"
}`}
>
@@ -154,7 +154,7 @@ export default function HeaderLatest() {
className="w-20 h-20 object-cover rounded-md"
/>
-
+
{post.categories?.[0]?.title ||
post.categoryName ||
"BERITA"}
@@ -170,7 +170,7 @@ export default function HeaderLatest() {
})}
-
+
{String(index + 1).padStart(2, "0")}
@@ -200,11 +200,11 @@ export default function HeaderLatest() {
id="email"
type="email"
placeholder="Your email address"
- className="w-full border rounded px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-yellow-400"
+ className="w-full border rounded px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"
/>
-
diff --git a/components/landing-page/health.tsx b/components/landing-page/health.tsx
new file mode 100644
index 0000000..c09a493
--- /dev/null
+++ b/components/landing-page/health.tsx
@@ -0,0 +1,186 @@
+"use client";
+
+import { useEffect, useState } from "react";
+import Image from "next/image";
+import Link from "next/link";
+import { getListArticle } from "@/service/article";
+
+type Article = {
+ id: number;
+ title: string;
+ description: string;
+ categoryName: string;
+ createdAt: string;
+ publishedAt: string;
+ slug: string;
+ createdByName: string;
+ customCreatorName?: string;
+ thumbnailUrl?: string;
+ categories?: { title: string }[];
+};
+
+export default function NewsTerkini() {
+ const [articles, setArticles] = useState