diff --git a/app/category/opinion-news/page.tsx b/app/category/opinion-news/page.tsx new file mode 100644 index 0000000..4f922c1 --- /dev/null +++ b/app/category/opinion-news/page.tsx @@ -0,0 +1,22 @@ +import BreakingNews from "@/components/landing-page/breaking-news"; +import Footer from "@/components/landing-page/footer"; +import Header from "@/components/landing-page/header"; +import HeaderLatest from "@/components/landing-page/header-latest"; +import Navbar from "@/components/landing-page/navbar"; +import News from "@/components/landing-page/news"; +import Opini from "@/components/landing-page/opini"; +import PopularNews from "@/components/landing-page/popular-news"; + +export default function Home() { + return ( +
+ +
+ +
+ + +
+ ); +} diff --git a/app/category/popular-news/page.tsx b/app/category/popular-news/page.tsx new file mode 100644 index 0000000..4f922c1 --- /dev/null +++ b/app/category/popular-news/page.tsx @@ -0,0 +1,22 @@ +import BreakingNews from "@/components/landing-page/breaking-news"; +import Footer from "@/components/landing-page/footer"; +import Header from "@/components/landing-page/header"; +import HeaderLatest from "@/components/landing-page/header-latest"; +import Navbar from "@/components/landing-page/navbar"; +import News from "@/components/landing-page/news"; +import Opini from "@/components/landing-page/opini"; +import PopularNews from "@/components/landing-page/popular-news"; + +export default function Home() { + return ( +
+ +
+ +
+ + +
+ ); +} diff --git a/app/category/protect/page.tsx b/app/category/protect/page.tsx new file mode 100644 index 0000000..4f922c1 --- /dev/null +++ b/app/category/protect/page.tsx @@ -0,0 +1,22 @@ +import BreakingNews from "@/components/landing-page/breaking-news"; +import Footer from "@/components/landing-page/footer"; +import Header from "@/components/landing-page/header"; +import HeaderLatest from "@/components/landing-page/header-latest"; +import Navbar from "@/components/landing-page/navbar"; +import News from "@/components/landing-page/news"; +import Opini from "@/components/landing-page/opini"; +import PopularNews from "@/components/landing-page/popular-news"; + +export default function Home() { + return ( +
+ +
+ +
+ + +
+ ); +} diff --git a/app/detail/[id]/page.tsx b/app/detail/[id]/page.tsx new file mode 100644 index 0000000..6aba50d --- /dev/null +++ b/app/detail/[id]/page.tsx @@ -0,0 +1,19 @@ +import DetailContent from "@/components/details/details-content"; +import Footer from "@/components/landing-page/footer"; +import Navbar from "@/components/landing-page/navbar"; +import Image from "next/image"; + +export default function Home() { + return ( +
+
+ +
+ +
+ +
+
+ ); +} diff --git a/components/details/details-content.tsx b/components/details/details-content.tsx index cd905e1..3ff7026 100644 --- a/components/details/details-content.tsx +++ b/components/details/details-content.tsx @@ -21,7 +21,7 @@ type Article = { title: string; }[]; files: { - file_url: string; + fileUrl: string; file_alt: string; }[]; }; @@ -56,6 +56,8 @@ export default function DetailContent() { null ); + const [selectedIndex, setSelectedIndex] = useState(0); + const [tabArticles, setTabArticles] = useState([]); const [activeTab, setActiveTab] = useState("trending"); @@ -154,16 +156,17 @@ export default function DetailContent() { useEffect(() => { initState(); - }, [page, showData, startDateValue, selectedCategories]); + }, [page, showData]); async function initState() { // loading(); const req = { limit: showData, - page, - search, - categorySlug: Array.from(selectedCategories).join(","), + page: 1, + search: "", + categorySlug: "", sort: "desc", + isPublish: true, sortBy: "created_at", }; @@ -188,22 +191,20 @@ export default function DetailContent() { setThumbnail(data?.thumbnailUrl); setDiseId(data?.aiArticleId); setDetailFiles(data?.files); - setArticleDetail(data); // <-- Add this + setArticleDetail(data); close(); } + if (!articleDetail?.files || articleDetail.files.length === 0) { + return ( +
+

Gambar tidak tersedia

+
+ ); + } + return ( <> -
- Background -

Home {">"}Detail

@@ -211,7 +212,7 @@ export default function DetailContent() { {articleDetail?.title}
-
+
- + {articleDetail?.createdByName} @@ -252,19 +253,41 @@ export default function DetailContent() {
- {articleDetail?.files?.[0]?.file_url ? ( + {/* Gambar utama */} +
Berita - ) : ( -
-

Gambar tidak tersedia

-
- )} +
+ + {/* Thumbnail */} +
+ {articleDetail.files.map((file: any, index: number) => ( + + ))} +
+ + {/* Slug */}

{articleDetail?.slug}

@@ -336,13 +359,13 @@ export default function DetailContent() {
-

- - Mikulnews.com - - - - {articleDetail?.description} -

+
+
+
@@ -360,34 +383,12 @@ export default function DetailContent() {
-
- Berita Utama -
-
-
- Author -
-

- christine natalia -

-
-
+

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib - ditandai * + ditandai *

@@ -396,7 +397,7 @@ export default function DetailContent() { htmlFor="komentar" className="block text-sm font-medium mb-1" > - Komentar * + Komentar *