-
-
-
-
- Bom Bunuh Diri Guncang Gereja di Damaskus, 20 Orang Tewas
- dan Puluhan Terluka
-
-
- 📅 23 JUNI 2025
-
+ {/* Artikel utama (featured) */}
+ {articles.length > 0 && (
+
+
+
+
+ {articles[0]?.title}
+
+
+ 📅{" "}
+ {new Date(articles[0]?.createdAt).toLocaleDateString(
+ "id-ID",
+ {
+ day: "2-digit",
+ month: "long",
+ year: "numeric",
+ }
+ )}
+
+
-
+ )}
+ {/* List artikel lain */}
-
-
-
-
- OPM Mulai Kehilangan Simpati dari Masyarakat Papua Usai
- Serang Gereja
-
-
- 📅 15 JUNI 2025
-
+ {articles.slice(1, 4).map((item) => (
+
+
+
+
+ {item.title}
+
+
+ 📅{" "}
+ {new Date(item.createdAt).toLocaleDateString(
+ "id-ID",
+ {
+ day: "2-digit",
+ month: "long",
+ year: "numeric",
+ }
+ )}
+
+
-
-
-
-
-
-
- Jakarta Terapkan Denda Rp 250.000 bagi Warga yang
- Merokok Sembarangan
-
-
- 📅 13 JUNI 2025
-
-
-
-
-
-
-
-
- Warga Indonesia Jadi Pengguna Internet via Ponsel
- Terbanyak di Dunia
-
-
- 📅 26 MEI 2025
-
-
-
+ ))}
diff --git a/components/landing-page/breaking-news.tsx b/components/landing-page/breaking-news.tsx
index 24cbe11..ac48d31 100644
--- a/components/landing-page/breaking-news.tsx
+++ b/components/landing-page/breaking-news.tsx
@@ -3,6 +3,7 @@
import React, { useEffect, useState } from "react";
import Image from "next/image";
import { getListArticle } from "@/service/article";
+import Link from "next/link";
type Article = {
id: number;
@@ -16,7 +17,7 @@ type Article = {
title: string;
}[];
files: {
- file_url: string;
+ fileUrl: string;
file_alt: string;
}[];
};
@@ -72,29 +73,31 @@ export default function BreakingNews() {
{articles.map((item) => (
-
-
-
- {item.title}
-
-
- By {item.createdByName} •{" "}
- {new Date(item.createdAt).toLocaleDateString("id-ID", {
- day: "numeric",
- month: "long",
- year: "numeric",
- })}
-
-
- {item.description}
-
-
+
+
+
+
+ {item.title}
+
+
+ By {item.createdByName} •{" "}
+ {new Date(item.createdAt).toLocaleDateString("id-ID", {
+ day: "numeric",
+ month: "long",
+ year: "numeric",
+ })}
+
+
+ {item.description}
+
+
+
))}
@@ -148,25 +151,30 @@ export default function BreakingNews() {
{/* Item pertama tampil besar */}
-
-
-
- {popular[0]?.title}
-
-
- 01
-
-
+
+
+
+
+ {popular[0]?.title}
+
+
+ 01
+
+
+
{/* Item sisanya */}
@@ -176,15 +184,17 @@ export default function BreakingNews() {
key={item.id}
className="flex gap-3 items-start border-b pb-2 last:border-b-0"
>
-
- 0{i + 2}
-
-
-
- {item.title}
-
-
0 Shares
-
+
+
+ 0{i + 2}
+
+
+
+ {item.title}
+
+
0 Shares
+
+
))}
diff --git a/components/landing-page/header-latest.tsx b/components/landing-page/header-latest.tsx
index 580d7bb..8779b9e 100644
--- a/components/landing-page/header-latest.tsx
+++ b/components/landing-page/header-latest.tsx
@@ -3,6 +3,7 @@
import React, { useEffect, useState } from "react";
import Image from "next/image";
import { getListArticle } from "@/service/article";
+import Link from "next/link";
type Article = {
id: number;
@@ -50,26 +51,28 @@ export default function HeaderLatest() {
return (
{/* Kiri - berita utama */}
-
-
-
-
- {articles[0]?.categories?.[0]?.title || "Uncategorized"}
-
-
{articles[0]?.title}
-
-
- {articles[0]?.createdByName}
- {" "}
- •{" "}
- {articles[0]?.createdAt &&
- new Date(articles[0].createdAt).toLocaleDateString("id-ID", {
- day: "numeric",
- month: "long",
- year: "numeric",
- })}
-
-
+
+
+
+
+
+ {articles[0]?.categories?.[0]?.title || "Uncategorized"}
+
+
{articles[0]?.title}
+
+
+ {articles[0]?.createdByName}
+ {" "}
+ •{" "}
+ {articles[0]?.createdAt &&
+ new Date(articles[0].createdAt).toLocaleDateString("id-ID", {
+ day: "numeric",
+ month: "long",
+ year: "numeric",
+ })}
+
+
+
{/* Kanan - 3 berita */}
@@ -86,33 +89,38 @@ export default function HeaderNews() {
key={item.id || `dummy-${idx}`}
className="relative overflow-hidden"
>
-
-
-
-
- {item.categories?.[0]?.title || "Uncategorized"}
-
-
- {item.title}
-
-
-
- {item.createdByName}
- {" "}
- •{" "}
- {item.createdAt &&
- new Date(item.createdAt).toLocaleDateString("id-ID", {
- day: "numeric",
- month: "short",
- year: "numeric",
- })}
-
-
+
+
+
+
+
+ {item.categories?.[0]?.title || "Uncategorized"}
+
+
+ {item.title}
+
+
+
+ {item.createdByName}
+ {" "}
+ •{" "}
+ {item.createdAt &&
+ new Date(item.createdAt).toLocaleDateString(
+ "id-ID",
+ {
+ day: "numeric",
+ month: "short",
+ year: "numeric",
+ }
+ )}
+
+
+
)
)}
@@ -121,36 +129,38 @@ export default function HeaderNews() {
{/* Bawah: 1 berita besar */}
{articles[3] && (
-
-
-
-
- {articles[3]?.categories?.[0]?.title || "Uncategorized"}
-
-
- {articles[3]?.title}
-
-
-
- {articles[3]?.createdByName}
- {" "}
- •{" "}
- {articles[3]?.createdAt &&
- new Date(articles[3].createdAt).toLocaleDateString(
- "id-ID",
- {
- day: "numeric",
- month: "long",
- year: "numeric",
- }
- )}
-
-
+
+
+
+
+
+ {articles[3]?.categories?.[0]?.title || "Uncategorized"}
+
+
+ {articles[3]?.title}
+
+
+
+ {articles[3]?.createdByName}
+ {" "}
+ •{" "}
+ {articles[3]?.createdAt &&
+ new Date(articles[3].createdAt).toLocaleDateString(
+ "id-ID",
+ {
+ day: "numeric",
+ month: "long",
+ year: "numeric",
+ }
+ )}
+
+
+
)}