diff --git a/app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/contact-us.tsx b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/contact-us.tsx similarity index 100% rename from app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/contact-us.tsx rename to app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/contact-us.tsx diff --git a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/hero-kaltara.tsx b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/hero-kaltara.tsx new file mode 100644 index 00000000..5cd55cb9 --- /dev/null +++ b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/hero-kaltara.tsx @@ -0,0 +1,171 @@ +"use client"; + +import { Reveal } from "@/components/landing-page/Reveal"; +import { Icon } from "@/components/ui/icon"; +import { Skeleton } from "@/components/ui/skeleton"; +import { listData } from "@/service/landing/landing"; +import { formatDateToIndonesian, getPublicLocaleTimestamp } from "@/utils/globals"; +import Image from "next/image"; +import { useParams } from "next/navigation"; +import React, { useEffect, useState } from "react"; + +const HeroKaltara = () => { + const params = useParams(); + const poldaName: any = params?.polda_name; + const [content, setContent] = useState([]); + const [centerPadding, setCenterPadding] = useState(); + const [isBannerLoading, setIsBannerLoading] = useState(true); + + useEffect(() => { + // async function initState() { + // const res = await listCarousel(); + // setContent(res?.data?.data); + // setCenterPadding(`${Math.trunc(Number(window.innerWidth) / 10 + 40)}px`); + // } + + async function fetchData() { + const res = await listData("1", "", "", 5, 0, "createdAt", "", "", poldaName); + let data = res?.data?.data?.content; + setContent(data); + setCenterPadding(`${Math.trunc(Number(window.innerWidth) / 10 + 40)}px`); + setIsBannerLoading(false); + console.log("Done", poldaName); + } + + fetchData(); + }, [params?.page]); + + const settings = { + className: "center", + // centerMode: true, + infinite: true, + centerPadding, + slidesToShow: 2, + autoplay: true, + speed: 1500, + autoplaySpeed: 15_000, + focusOnSelect: true, + responsive: [ + { + breakpoint: 768, + settings: { + arrows: false, + centerMode: true, + centerPadding: "60px", + slidesToShow: 1, + }, + }, + { + breakpoint: 480, + settings: { + arrows: false, + centerMode: true, + centerPadding: "20px", + slidesToShow: 1, + }, + }, + ], + }; + + return ( + <> + +
+ {isBannerLoading ? ( +
+ +
+ + +
+
+ ) : ( +
+ {content?.map((row: any) => ( +
+ gambar-utama

{row.title}

+
+

{row?.categoryName}

+

+ {getPublicLocaleTimestamp(new Date(row?.createdAt))} WIB {" | "} + {row?.clickCount} +

+
+

{row?.description}

+
+ ))} +
+ )} + + {isBannerLoading ? ( +
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ ) : ( +
+ {content?.map((item: any) => ( +
+
+ +
+
+

{item?.title}

+
+

{item?.categoryName}

+

+ {formatDateToIndonesian(new Date(item?.createdAt))} {item?.timezone ? item?.timezone : "WIB"}|{" "} + + + {" "} + {item?.clickCount}{" "} +

+
+
+
+ ))} +
+ )} +
+
+ + ); +}; + +export default HeroKaltara; diff --git a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/latest-news.tsx b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/latest-news.tsx new file mode 100644 index 00000000..5bc1fbcf --- /dev/null +++ b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/latest-news.tsx @@ -0,0 +1,189 @@ +"use client"; + +import { Reveal } from "@/components/landing-page/Reveal"; +import { Skeleton } from "@/components/ui/skeleton"; +import { listData } from "@/service/landing/landing"; +import { formatDateToIndonesian } from "@/utils/globals"; +import { useTranslations } from "next-intl"; +import Image from "next/image"; +import { useParams } from "next/navigation"; +import React, { useEffect, useState } from "react"; + +const LatestNews = (props: { type: string }) => { + const [isLoading, setIsLoading] = useState(true); + const params = useParams(); + const [content, setContent] = useState([]); + const [centerPadding, setCenterPadding] = useState(); + const [isBannerLoading, setIsBannerLoading] = useState(true); + const poldaName: any = params?.polda_name; + const t = useTranslations("LandingPage"); + + useEffect(() => { + const timer = setTimeout(() => { + setIsLoading(false); + }, 3000); + + return () => clearTimeout(timer); + }, []); + + // useEffect(() => { + // async function fetchCategories() { + // const url = "https://netidhub.com/api/csrf"; + + // try { + // const response = await fetch(url); + + // if (!response.ok) { + // throw new Error(`HTTP error! status: ${response.status}`); + // } + + // const data = await response.json(); + // return data; // Menampilkan data yang diterima dari API + // } catch (error) { + // console.error("Fetch error: ", error); + // } + // } + + // fetchCategories(); + // initFetch(); + // }, []); + + // const initFetch = async () => { + // const response = await getHeroData(); + // console.log(response); + // setHeroData(response?.data?.data?.content); + // }; + + useEffect(() => { + // async function initState() { + // const res = await listCarousel(); + // setContent(res?.data?.data); + // setCenterPadding(`${Math.trunc(Number(window.innerWidth) / 10 + 40)}px`); + // } + + async function fetchData() { + const sortBy = poldaName === "popular" ? "clickCount" : "createdAt"; + const res = await listData("1", "", "", 5, 0, sortBy, "", "", poldaName); + let data = res?.data?.data?.content; + setContent(data); + setCenterPadding(`${Math.trunc(Number(window.innerWidth) / 10 + 40)}px`); + setIsBannerLoading(false); + console.log("Done", poldaName); + } + + fetchData(); + }, [params?.page]); + + return ( + <> + +
+
+

Berita {props.type == "popular" ? "Terpopuler" : props.type == "latest" ? t("new") : "Serupa"}

+
+
+
+ {isLoading ? ( +
+ +
+ + +
+
+ ) : ( +
+ {content?.map((row: any) => ( +
+ gambar-utama

{row?.title}

+
+

{row?.categoryName}

+

+ {formatDateToIndonesian(new Date(row?.createdAt))} {row?.timezone ? row?.timezone : "WIB"}|{" "} + + + {" "} + {row?.clickCount}{" "} +

+
+

{row?.description}

+
+ ))} +
+ )} + + {isLoading ? ( +
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ ) : ( +
+ {content?.map((item: any) => ( +
+ {/*
+ +
*/} +
+

{item?.title}

+
+

{item?.categoryName}

+

+ {formatDateToIndonesian(new Date(item?.createdAt))} {item?.timezone ? item?.timezone : "WIB"}|{" "} + + + {" "} + {item?.clickCount}{" "} +

+
+
+
+ ))} +
+ )} +
+
+ + ); +}; + +export default LatestNews; diff --git a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/national-news.tsx b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/national-news.tsx new file mode 100644 index 00000000..fda14bf1 --- /dev/null +++ b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/national-news.tsx @@ -0,0 +1,186 @@ +"use client"; + +import { Reveal } from "@/components/landing-page/Reveal"; +import { Skeleton } from "@/components/ui/skeleton"; +import { getHeroData, listData } from "@/service/landing/landing"; +import { formatDateToIndonesian } from "@/utils/globals"; +import Image from "next/image"; +import { useParams } from "next/navigation"; +import React, { useEffect, useState } from "react"; + +const NationalNews = () => { + const [isLoading, setIsLoading] = useState(true); + const params = useParams(); + const poldaName: any = params?.polda_name; + const [content, setContent] = useState([]); + const [centerPadding, setCenterPadding] = useState(); + const [isBannerLoading, setIsBannerLoading] = useState(true); + + useEffect(() => { + const timer = setTimeout(() => { + setIsLoading(false); + }, 3000); + + return () => clearTimeout(timer); + }, []); + + // useEffect(() => { + // async function fetchCategories() { + // const url = "https://netidhub.com/api/csrf"; + + // try { + // const response = await fetch(url); + + // if (!response.ok) { + // throw new Error(`HTTP error! status: ${response.status}`); + // } + + // const data = await response.json(); + // return data; // Menampilkan data yang diterima dari API + // } catch (error) { + // console.error("Fetch error: ", error); + // } + // } + + // fetchCategories(); + // initFetch(); + // }, []); + + useEffect(() => { + // async function initState() { + // const res = await listCarousel(); + // setContent(res?.data?.data); + // setCenterPadding(`${Math.trunc(Number(window.innerWidth) / 10 + 40)}px`); + // } + + async function fetchData() { + const res = await listData("1", "", "", 5, 0, "createdAt", "", "", poldaName); + let data = res?.data?.data?.content; + setContent(data); + setCenterPadding(`${Math.trunc(Number(window.innerWidth) / 10 + 40)}px`); + setIsBannerLoading(false); + console.log("Done", poldaName); + } + + fetchData(); + }, [params?.page]); + + // const initFetch = async () => { + // const response = await getHeroData(); + // console.log(response); + // setHeroData(response?.data?.data?.content); + // }; + + return ( + <> + +
+
+

Berita Nasional

+
+
+
+ {isLoading ? ( +
+ +
+ + +
+
+ ) : ( +
+ {content?.map((row: any) => ( +
+ gambar-utama

{row?.title}

+
+

{row?.categoryName}

+

+ {formatDateToIndonesian(new Date(row?.createdAt))} {row?.timezone ? row?.timezone : "WIB"}|{" "} + + + {" "} + {row?.clickCount}{" "} +

+
+

{row?.description}

+
+ ))} +
+ )} + + {isLoading ? ( +
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ ) : ( +
+ {content?.map((item: any) => ( +
+ {/*
+ +
*/} +
+

{item?.title}

+
+

{item?.categoryName}

+

+ {formatDateToIndonesian(new Date(item?.createdAt))} {item?.timezone ? item?.timezone : "WIB"}|{" "} + + + {" "} + {item?.clickCount}{" "} +

+
+
+
+ ))} +
+ )} +
+
+ + ); +}; + +export default NationalNews; diff --git a/app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/navbar-kaltara.tsx b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/navbar-kaltara.tsx similarity index 73% rename from app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/navbar-kaltara.tsx rename to app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/navbar-kaltara.tsx index 8b335174..c0e91c70 100644 --- a/app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/navbar-kaltara.tsx +++ b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/navbar-kaltara.tsx @@ -36,12 +36,12 @@ const category = [ ]; const categoryLinks: any = { - Nasional: "/news/nasional", - Kaltara: "/news/kaltara", - Keamanan: "/security", - Kesehatan: "/health", - Olahraga: "/sports", - PPA: "/ppa", + Nasional: "https://tribratanews.kaltara.polri.go.id/category/nasional/", + Kaltara: "https://tribratanews.kaltara.polri.go.id/category/kaltara/", + Keamanan: "https://tribratanews.kaltara.polri.go.id/category/keamanan/", + Kesehatan: "https://tribratanews.kaltara.polri.go.id/category/kesehatan/", + Olahraga: "https://tribratanews.kaltara.polri.go.id/category/olahraga/", + PPA: "https://tribratanews.kaltara.polri.go.id/category/ppa/", MediaHub: "https://mediahub.polri.go.id/", }; @@ -59,10 +59,12 @@ const NavbarKaltara = () => { ))} - + + + {/* Mobile Menu Toggle */} @@ -80,7 +82,7 @@ const NavbarKaltara = () => { {/* Mobile Menu */} {menuOpen && ( -
+
{category?.map((data: any) => ( @@ -88,10 +90,12 @@ const NavbarKaltara = () => { ))}
- + + +
)}
diff --git a/app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/news-tickers-kaltara.tsx b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/news-tickers-kaltara.tsx similarity index 68% rename from app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/news-tickers-kaltara.tsx rename to app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/news-tickers-kaltara.tsx index 26a18c7c..7739d122 100644 --- a/app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/news-tickers-kaltara.tsx +++ b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/news-tickers-kaltara.tsx @@ -60,25 +60,25 @@ export default function NewsTickerKaltara() { return (
-
- {tanggal} +
+ {tanggal}
-
{t("breakingNews")} :
-
+
{t("breakingNews")} :
+
-

{article[currentNewsIndex]?.title}

+

{article[currentNewsIndex]?.title}

-

{textEllipsis(article[currentNewsIndex]?.title, 28)}

+

{textEllipsis(article[currentNewsIndex]?.title, 28)}

-

{formatDateToIndonesian(article[currentNewsIndex]?.createdAt)}

+

{formatDateToIndonesian(article[currentNewsIndex]?.createdAt)}

diff --git a/app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/popular-news.tsx b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/popular-news.tsx similarity index 100% rename from app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/popular-news.tsx rename to app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/popular-news.tsx diff --git a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/regional-news.tsx b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/regional-news.tsx new file mode 100644 index 00000000..3cddef02 --- /dev/null +++ b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/regional-news.tsx @@ -0,0 +1,188 @@ +"use client"; + +import { Reveal } from "@/components/landing-page/Reveal"; +import { Skeleton } from "@/components/ui/skeleton"; +import { getHeroData, listData } from "@/service/landing/landing"; +import { formatDateToIndonesian } from "@/utils/globals"; +import Image from "next/image"; +import { useParams } from "next/navigation"; +import React, { useEffect, useState } from "react"; + +const RegionalNews = () => { + const [isLoading, setIsLoading] = useState(true); + const params = useParams(); + const locale = params?.locale; + const [heroData, setHeroData] = useState(); + const poldaName: any = params?.polda_name; + const [content, setContent] = useState([]); + const [centerPadding, setCenterPadding] = useState(); + const [isBannerLoading, setIsBannerLoading] = useState(true); + + useEffect(() => { + const timer = setTimeout(() => { + setIsLoading(false); + }, 3000); + + return () => clearTimeout(timer); + }, []); + + // useEffect(() => { + // async function fetchCategories() { + // const url = "https://netidhub.com/api/csrf"; + + // try { + // const response = await fetch(url); + + // if (!response.ok) { + // throw new Error(`HTTP error! status: ${response.status}`); + // } + + // const data = await response.json(); + // return data; // Menampilkan data yang diterima dari API + // } catch (error) { + // console.error("Fetch error: ", error); + // } + // } + + // fetchCategories(); + // initFetch(); + // }, []); + + // const initFetch = async () => { + // const response = await getHeroData(); + // console.log(response); + // setHeroData(response?.data?.data?.content); + // }; + + useEffect(() => { + // async function initState() { + // const res = await listCarousel(); + // setContent(res?.data?.data); + // setCenterPadding(`${Math.trunc(Number(window.innerWidth) / 10 + 40)}px`); + // } + + async function fetchData() { + const res = await listData("1", "", "", 5, 0, "createdAt", "", "", poldaName); + let data = res?.data?.data?.content; + setContent(data); + setCenterPadding(`${Math.trunc(Number(window.innerWidth) / 10 + 40)}px`); + setIsBannerLoading(false); + console.log("Done", poldaName); + } + + fetchData(); + }, [params?.page]); + + return ( + <> + +
+
+

Berita Wilayah

+
+
+
+ {isLoading ? ( +
+ +
+ + +
+
+ ) : ( +
+ {content?.map((row: any) => ( +
+ gambar-utama

{row?.title}

+
+

{row?.categoryName}

+

+ {formatDateToIndonesian(new Date(row?.createdAt))} {row?.timezone ? row?.timezone : "WIB"}|{" "} + + + {" "} + {row?.clickCount}{" "} +

+
+

{row?.description}

+
+ ))} +
+ )} + + {isLoading ? ( +
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ +
+ + +
+
+
+ ) : ( +
+ {content?.map((item: any) => ( +
+ {/*
+ +
*/} +
+

{item?.title}

+
+

{item?.categoryName}

+

+ {formatDateToIndonesian(new Date(item?.createdAt))} {item?.timezone ? item?.timezone : "WIB"}|{" "} + + + {" "} + {item?.clickCount}{" "} +

+
+
+
+ ))} +
+ )} +
+
+ + ); +}; + +export default RegionalNews; diff --git a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/social-media.tsx b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/social-media.tsx new file mode 100644 index 00000000..9a3e2dad --- /dev/null +++ b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/social-media.tsx @@ -0,0 +1,224 @@ +import React, { useState } from "react"; +import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import Image from "next/image"; +import { Icon } from "@/components/ui/icon"; +import { Link } from "@/i18n/routing"; +import { Reveal } from "@/components/landing-page/Reveal"; + +const SocialMedia = () => { + const [selectedTab, setSelectedTab] = useState("x"); + + return ( + <> + +
+
Media Sosial
+
+ + + + X{" "} + +
|
+ + Instagram + +
|
+ + Facebook + +
|
+ + Tiktok + +
|
+ + Youtube + +
+
+
+
+ {selectedTab == "x" ? ( +
+
+
+ {" "} + +
+
+
+

Humas_PoldaKaltara

+ + + +
+

@HumasKaltara

+
+
+
+
+

+ Lorem ipsum dolor sit, amet consectetur adipisicing elit. Maxime quo fugiat soluta. Possimus est inventore, quidem eligendi fugit repudiandae dicta saepe perspiciatis corrupti quae sapiente accusantium cumque et dolor + ut ullam tempora deserunt dolore consequatur! +

+ {" "} +
+
+
+ ) : selectedTab == "instagram" ? ( +
+
+
+ {" "} + +
+
+
+

TBNews Mabes Polri

+ + + +
+

@TBNewsMabes

+
+
+
+
+

+ Lorem ipsum dolor sit, amet consectetur adipisicing elit. Maxime quo fugiat soluta. Possimus est inventore, quidem eligendi fugit repudiandae dicta saepe perspiciatis corrupti quae sapiente accusantium cumque et dolor + ut ullam tempora deserunt dolore consequatur! +

+ {" "} +
+
+
+ ) : selectedTab == "facebook" ? ( +
+
+
+ {" "} + +
+
+
+

TBNews Mabes Polri

+ + + +
+

@TBNewsMabes

+
+
+
+
+

+ Lorem ipsum dolor sit, amet consectetur adipisicing elit. Maxime quo fugiat soluta. Possimus est inventore, quidem eligendi fugit repudiandae dicta saepe perspiciatis corrupti quae sapiente accusantium cumque et dolor + ut ullam tempora deserunt dolore consequatur! +

+ {" "} +
+
+
+ ) : selectedTab == "tiktok" ? ( +
+
+
+ {" "} + +
+
+
+

TBNews Mabes Polri

+ + + +
+

@TBNewsMabes

+
+
+
+
+

+ Lorem ipsum dolor sit, amet consectetur adipisicing elit. Maxime quo fugiat soluta. Possimus est inventore, quidem eligendi fugit repudiandae dicta saepe perspiciatis corrupti quae sapiente accusantium cumque et dolor + ut ullam tempora deserunt dolore consequatur! +

+ {" "} +
+
+
+ ) : selectedTab == "youtube" ? ( +
+
+
+ {" "} + +
+
+
+

TBNews Mabes Polri

+ + + +
+

@TBNewsMabes

+
+
+
+
+

+ Lorem ipsum dolor sit, amet consectetur adipisicing elit. Maxime quo fugiat soluta. Possimus est inventore, quidem eligendi fugit repudiandae dicta saepe perspiciatis corrupti quae sapiente accusantium cumque et dolor + ut ullam tempora deserunt dolore consequatur! +

+ {" "} +
+
+
+ ) : ( +

+ empty +

+ )} +
+
+ + Lihat Semua + +
+
+
+ + ); +}; + +export default SocialMedia; diff --git a/app/[locale]/(public)/(polda)/tbnews/polda-kaltara/page.tsx b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/page.tsx similarity index 88% rename from app/[locale]/(public)/(polda)/tbnews/polda-kaltara/page.tsx rename to app/[locale]/(public)/(polda)/tbnews/[polda_name]/page.tsx index 25d49596..79e1ab0f 100644 --- a/app/[locale]/(public)/(polda)/tbnews/polda-kaltara/page.tsx +++ b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/page.tsx @@ -16,8 +16,9 @@ const PoldaKaltara = () => {
- - + + + {/* */} diff --git a/app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/hero-kaltara.tsx b/app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/hero-kaltara.tsx deleted file mode 100644 index 1feef348..00000000 --- a/app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/hero-kaltara.tsx +++ /dev/null @@ -1,161 +0,0 @@ -"use client"; - -import { Skeleton } from "@/components/ui/skeleton"; -import { getHeroData } from "@/service/landing/landing"; -import { formatDateToIndonesian } from "@/utils/globals"; -import Image from "next/image"; -import { useParams } from "next/navigation"; -import React, { useEffect, useState } from "react"; - -const HeroKaltara = () => { - const [isLoading, setIsLoading] = useState(true); - const params = useParams(); - const locale = params?.locale; - const [heroData, setHeroData] = useState(); - - useEffect(() => { - const timer = setTimeout(() => { - setIsLoading(false); - }, 3000); - - return () => clearTimeout(timer); - }, []); - - useEffect(() => { - async function fetchCategories() { - const url = "https://netidhub.com/api/csrf"; - - try { - const response = await fetch(url); - - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`); - } - - const data = await response.json(); - return data; // Menampilkan data yang diterima dari API - } catch (error) { - console.error("Fetch error: ", error); - } - } - - fetchCategories(); - initFetch(); - }, []); - - const initFetch = async () => { - const response = await getHeroData(); - console.log(response); - setHeroData(response?.data?.data?.content); - }; - - return ( -
- {isLoading ? ( -
- -
- - -
-
- ) : ( -
- {heroData?.length > 0 && ( -
- gambar-utama{" "} -

{heroData[0]?.title}

-
-

{heroData[0]?.categoryName}

-

- {formatDateToIndonesian(new Date(heroData[0]?.createdAt))} {heroData[0]?.timezone ? heroData[0]?.timezone : "WIB"}|{" "} - - - {" "} - {heroData[0]?.clickCount}{" "} -

-
-

- Lorem ipsum dolor sit amet consectetur adipisicing elit. Repudiandae eum consectetur cum placeat non aperiam suscipit libero ipsa commodi. Quam dicta eligendi voluptate, ab sunt ratione accusamus esse animi vel libero veniam - nulla tenetur ipsum provident minus. Error ad eligendi quasi autem neque ex, iste perspiciatis magnam. Magni, quos sequi. Lorem ipsum, dolor sit amet consectetur adipisicing elit. Velit rem veniam doloribus saepe atque quia - ut quaerat fugit harum. Velit quia quisquam consectetur blanditiis porro itaque perferendis. Voluptatibus fuga ipsam maxime, hic doloribus inventore, odio eos molestiae velit cum placeat! Est nostrum quas veritatis deserunt - itaque illum alias. Assumenda deleniti similique id. -

-
- )} -
- )} - - {isLoading ? ( -
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- ) : ( -
- {heroData?.slice(0, 3).map((item: any) => ( -
-
- -
-
-

{item?.title}

-
-

{item?.categoryName}

-

- {formatDateToIndonesian(new Date(item?.createdAt))} {item?.timezone ? item?.timezone : "WIB"}|{" "} - - - {" "} - {item?.clickCount}{" "} -

-
-
-
- ))} -
- )} -
- ); -}; - -export default HeroKaltara; diff --git a/app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/latest-news.tsx b/app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/latest-news.tsx deleted file mode 100644 index ca0ce048..00000000 --- a/app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/latest-news.tsx +++ /dev/null @@ -1,168 +0,0 @@ -"use client"; - -import { Skeleton } from "@/components/ui/skeleton"; -import { getHeroData } from "@/service/landing/landing"; -import { formatDateToIndonesian } from "@/utils/globals"; -import Image from "next/image"; -import { useParams } from "next/navigation"; -import React, { useEffect, useState } from "react"; - -const LatestNews = () => { - const [isLoading, setIsLoading] = useState(true); - const params = useParams(); - const locale = params?.locale; - const [heroData, setHeroData] = useState(); - - useEffect(() => { - const timer = setTimeout(() => { - setIsLoading(false); - }, 3000); - - return () => clearTimeout(timer); - }, []); - - useEffect(() => { - async function fetchCategories() { - const url = "https://netidhub.com/api/csrf"; - - try { - const response = await fetch(url); - - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`); - } - - const data = await response.json(); - return data; // Menampilkan data yang diterima dari API - } catch (error) { - console.error("Fetch error: ", error); - } - } - - fetchCategories(); - initFetch(); - }, []); - - const initFetch = async () => { - const response = await getHeroData(); - console.log(response); - setHeroData(response?.data?.data?.content); - }; - - return ( - <> -
-
-

Berita Terbaru

-
-
-
- {isLoading ? ( -
- -
- - -
-
- ) : ( -
- {heroData?.length > 0 && ( -
- gambar-utama{" "} -

{heroData[0]?.title}

-
-

{heroData[0]?.categoryName}

-

- {formatDateToIndonesian(new Date(heroData[0]?.createdAt))} {heroData[0]?.timezone ? heroData[0]?.timezone : "WIB"}|{" "} - - - {" "} - {heroData[0]?.clickCount}{" "} -

-
-

- Lorem ipsum dolor sit amet consectetur adipisicing elit. Repudiandae eum consectetur cum placeat non aperiam suscipit libero ipsa commodi. Quam dicta eligendi voluptate, ab sunt ratione accusamus esse animi vel libero - veniam nulla tenetur ipsum provident minus. Error ad eligendi quasi autem neque ex, iste perspiciatis magnam. Magni, quos sequi. Lorem ipsum, dolor sit amet consectetur adipisicing elit. Velit rem veniam doloribus saepe - atque quia ut quaerat fugit harum. Velit quia quisquam consectetur blanditiis porro itaque perferendis. Voluptatibus fuga ipsam maxime, hic doloribus inventore, odio eos molestiae velit cum placeat! Est nostrum quas - veritatis deserunt itaque illum alias. Assumenda deleniti similique id. -

-
- )} -
- )} - - {isLoading ? ( -
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- ) : ( -
- {heroData?.map((item: any) => ( -
- {/*
- -
*/} -
-

{item?.title}

-
-

{item?.categoryName}

-

- {formatDateToIndonesian(new Date(item?.createdAt))} {item?.timezone ? item?.timezone : "WIB"}|{" "} - - - {" "} - {item?.clickCount}{" "} -

-
-
-
- ))} -
- )} -
- - ); -}; - -export default LatestNews; diff --git a/app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/national-news.tsx b/app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/national-news.tsx deleted file mode 100644 index 02fa936a..00000000 --- a/app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/national-news.tsx +++ /dev/null @@ -1,168 +0,0 @@ -"use client"; - -import { Skeleton } from "@/components/ui/skeleton"; -import { getHeroData } from "@/service/landing/landing"; -import { formatDateToIndonesian } from "@/utils/globals"; -import Image from "next/image"; -import { useParams } from "next/navigation"; -import React, { useEffect, useState } from "react"; - -const NationalNews = () => { - const [isLoading, setIsLoading] = useState(true); - const params = useParams(); - const locale = params?.locale; - const [heroData, setHeroData] = useState(); - - useEffect(() => { - const timer = setTimeout(() => { - setIsLoading(false); - }, 3000); - - return () => clearTimeout(timer); - }, []); - - useEffect(() => { - async function fetchCategories() { - const url = "https://netidhub.com/api/csrf"; - - try { - const response = await fetch(url); - - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`); - } - - const data = await response.json(); - return data; // Menampilkan data yang diterima dari API - } catch (error) { - console.error("Fetch error: ", error); - } - } - - fetchCategories(); - initFetch(); - }, []); - - const initFetch = async () => { - const response = await getHeroData(); - console.log(response); - setHeroData(response?.data?.data?.content); - }; - - return ( - <> -
-
-

Berita Nasional

-
-
-
- {isLoading ? ( -
- -
- - -
-
- ) : ( -
- {heroData?.length > 0 && ( -
- gambar-utama{" "} -

{heroData[0]?.title}

-
-

{heroData[0]?.categoryName}

-

- {formatDateToIndonesian(new Date(heroData[0]?.createdAt))} {heroData[0]?.timezone ? heroData[0]?.timezone : "WIB"}|{" "} - - - {" "} - {heroData[0]?.clickCount}{" "} -

-
-

- Lorem ipsum dolor sit amet consectetur adipisicing elit. Repudiandae eum consectetur cum placeat non aperiam suscipit libero ipsa commodi. Quam dicta eligendi voluptate, ab sunt ratione accusamus esse animi vel libero - veniam nulla tenetur ipsum provident minus. Error ad eligendi quasi autem neque ex, iste perspiciatis magnam. Magni, quos sequi. Lorem ipsum, dolor sit amet consectetur adipisicing elit. Velit rem veniam doloribus saepe - atque quia ut quaerat fugit harum. Velit quia quisquam consectetur blanditiis porro itaque perferendis. Voluptatibus fuga ipsam maxime, hic doloribus inventore, odio eos molestiae velit cum placeat! Est nostrum quas - veritatis deserunt itaque illum alias. Assumenda deleniti similique id. -

-
- )} -
- )} - - {isLoading ? ( -
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- ) : ( -
- {heroData?.map((item: any) => ( -
- {/*
- -
*/} -
-

{item?.title}

-
-

{item?.categoryName}

-

- {formatDateToIndonesian(new Date(item?.createdAt))} {item?.timezone ? item?.timezone : "WIB"}|{" "} - - - {" "} - {item?.clickCount}{" "} -

-
-
-
- ))} -
- )} -
- - ); -}; - -export default NationalNews; diff --git a/app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/regional-news.tsx b/app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/regional-news.tsx deleted file mode 100644 index 93601642..00000000 --- a/app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/regional-news.tsx +++ /dev/null @@ -1,168 +0,0 @@ -"use client"; - -import { Skeleton } from "@/components/ui/skeleton"; -import { getHeroData } from "@/service/landing/landing"; -import { formatDateToIndonesian } from "@/utils/globals"; -import Image from "next/image"; -import { useParams } from "next/navigation"; -import React, { useEffect, useState } from "react"; - -const RegionalNews = () => { - const [isLoading, setIsLoading] = useState(true); - const params = useParams(); - const locale = params?.locale; - const [heroData, setHeroData] = useState(); - - useEffect(() => { - const timer = setTimeout(() => { - setIsLoading(false); - }, 3000); - - return () => clearTimeout(timer); - }, []); - - useEffect(() => { - async function fetchCategories() { - const url = "https://netidhub.com/api/csrf"; - - try { - const response = await fetch(url); - - if (!response.ok) { - throw new Error(`HTTP error! status: ${response.status}`); - } - - const data = await response.json(); - return data; // Menampilkan data yang diterima dari API - } catch (error) { - console.error("Fetch error: ", error); - } - } - - fetchCategories(); - initFetch(); - }, []); - - const initFetch = async () => { - const response = await getHeroData(); - console.log(response); - setHeroData(response?.data?.data?.content); - }; - - return ( - <> -
-
-

Berita Wilayah

-
-
-
- {isLoading ? ( -
- -
- - -
-
- ) : ( -
- {heroData?.length > 0 && ( -
- gambar-utama{" "} -

{heroData[0]?.title}

-
-

{heroData[0]?.categoryName}

-

- {formatDateToIndonesian(new Date(heroData[0]?.createdAt))} {heroData[0]?.timezone ? heroData[0]?.timezone : "WIB"}|{" "} - - - {" "} - {heroData[0]?.clickCount}{" "} -

-
-

- Lorem ipsum dolor sit amet consectetur adipisicing elit. Repudiandae eum consectetur cum placeat non aperiam suscipit libero ipsa commodi. Quam dicta eligendi voluptate, ab sunt ratione accusamus esse animi vel libero - veniam nulla tenetur ipsum provident minus. Error ad eligendi quasi autem neque ex, iste perspiciatis magnam. Magni, quos sequi. Lorem ipsum, dolor sit amet consectetur adipisicing elit. Velit rem veniam doloribus saepe - atque quia ut quaerat fugit harum. Velit quia quisquam consectetur blanditiis porro itaque perferendis. Voluptatibus fuga ipsam maxime, hic doloribus inventore, odio eos molestiae velit cum placeat! Est nostrum quas - veritatis deserunt itaque illum alias. Assumenda deleniti similique id. -

-
- )} -
- )} - - {isLoading ? ( -
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- ) : ( -
- {heroData?.map((item: any) => ( -
- {/*
- -
*/} -
-

{item?.title}

-
-

{item?.categoryName}

-

- {formatDateToIndonesian(new Date(item?.createdAt))} {item?.timezone ? item?.timezone : "WIB"}|{" "} - - - {" "} - {item?.clickCount}{" "} -

-
-
-
- ))} -
- )} -
- - ); -}; - -export default RegionalNews; diff --git a/app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/social-media.tsx b/app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/social-media.tsx deleted file mode 100644 index 43426d80..00000000 --- a/app/[locale]/(public)/(polda)/tbnews/polda-kaltara/components/social-media.tsx +++ /dev/null @@ -1,219 +0,0 @@ -import React, { useState } from "react"; -import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs"; -import Image from "next/image"; -import { Icon } from "@/components/ui/icon"; -import { Link } from "@/i18n/routing"; - -const SocialMedia = () => { - const [selectedTab, setSelectedTab] = useState("x"); - - return ( -
-
Media Sosial
-
- - - - X{" "} - -
|
- - Instagram - -
|
- - Facebook - -
|
- - Tiktok - -
|
- - Youtube - -
-
-
-
- {selectedTab == "x" ? ( -
-
-
- {" "} - -
-
-
-

Humas_PoldaKaltara

- - - -
-

@HumasKaltara

-
-
-
-
-

- Lorem ipsum dolor sit, amet consectetur adipisicing elit. Maxime quo fugiat soluta. Possimus est inventore, quidem eligendi fugit repudiandae dicta saepe perspiciatis corrupti quae sapiente accusantium cumque et dolor ut - ullam tempora deserunt dolore consequatur! -

- {" "} -
-
-
- ) : selectedTab == "instagram" ? ( -
-
-
- {" "} - -
-
-
-

TBNews Mabes Polri

- - - -
-

@TBNewsMabes

-
-
-
-
-

- Lorem ipsum dolor sit, amet consectetur adipisicing elit. Maxime quo fugiat soluta. Possimus est inventore, quidem eligendi fugit repudiandae dicta saepe perspiciatis corrupti quae sapiente accusantium cumque et dolor ut - ullam tempora deserunt dolore consequatur! -

- {" "} -
-
-
- ) : selectedTab == "facebook" ? ( -
-
-
- {" "} - -
-
-
-

TBNews Mabes Polri

- - - -
-

@TBNewsMabes

-
-
-
-
-

- Lorem ipsum dolor sit, amet consectetur adipisicing elit. Maxime quo fugiat soluta. Possimus est inventore, quidem eligendi fugit repudiandae dicta saepe perspiciatis corrupti quae sapiente accusantium cumque et dolor ut - ullam tempora deserunt dolore consequatur! -

- {" "} -
-
-
- ) : selectedTab == "tiktok" ? ( -
-
-
- {" "} - -
-
-
-

TBNews Mabes Polri

- - - -
-

@TBNewsMabes

-
-
-
-
-

- Lorem ipsum dolor sit, amet consectetur adipisicing elit. Maxime quo fugiat soluta. Possimus est inventore, quidem eligendi fugit repudiandae dicta saepe perspiciatis corrupti quae sapiente accusantium cumque et dolor ut - ullam tempora deserunt dolore consequatur! -

- {" "} -
-
-
- ) : selectedTab == "youtube" ? ( -
-
-
- {" "} - -
-
-
-

TBNews Mabes Polri

- - - -
-

@TBNewsMabes

-
-
-
-
-

- Lorem ipsum dolor sit, amet consectetur adipisicing elit. Maxime quo fugiat soluta. Possimus est inventore, quidem eligendi fugit repudiandae dicta saepe perspiciatis corrupti quae sapiente accusantium cumque et dolor ut - ullam tempora deserunt dolore consequatur! -

- {" "} -
-
-
- ) : ( -

- empty -

- )} -
-
- - Lihat Semua - -
-
- ); -}; - -export default SocialMedia; diff --git a/app/[locale]/page.tsx b/app/[locale]/page.tsx index a9562683..54bbe7c3 100644 --- a/app/[locale]/page.tsx +++ b/app/[locale]/page.tsx @@ -12,6 +12,7 @@ import Navbar from "@/components/landing-page/navbar"; import { ReactLenis } from "@studio-freight/react-lenis"; import MountedProvider from "@/providers/mounted.provider"; import NewsTicker from "@/components/landing-page/news-tickers"; +import AreaCoverageWorkUnits from "@/components/landing-page/area-coverage-and-work-units"; const Home = ({ params: { locale } }: { params: { locale: string } }) => { return ( @@ -25,8 +26,9 @@ const Home = ({ params: { locale } }: { params: { locale: string } }) => { {/* */} - - + {/* */} + {/* */} +
diff --git a/components/landing-page/area-coverage-and-work-units.tsx b/components/landing-page/area-coverage-and-work-units.tsx new file mode 100644 index 00000000..748a6bae --- /dev/null +++ b/components/landing-page/area-coverage-and-work-units.tsx @@ -0,0 +1,68 @@ +"use client"; + +import React from "react"; +import { Dialog, DialogClose, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog"; +import Image from "next/image"; +import Coverage from "./coverage"; + +const AreaCoverageWorkUnits = () => { + return ( +
+

+ Liputan Wilayah & Satker +

+
+
+ {/* POLDA */} + + + indo +

Polda Jajaran

+
+ + + +

Polda Jajaran

+
+ +
+
+
+ +
+ + + +
+
+
+ + {/* SATKER */} + + + indo +

Polda Jajaran

+
+ + + +

Satuan Kerja Polri

+
+ +
+
+
+ +
+ + + +
+
+
+
+
+ ); +}; + +export default AreaCoverageWorkUnits; diff --git a/components/landing-page/coverage.tsx b/components/landing-page/coverage.tsx index 2d4cf257..93a2027f 100644 --- a/components/landing-page/coverage.tsx +++ b/components/landing-page/coverage.tsx @@ -30,7 +30,7 @@ const regions = [ { name: "Polda Kalimantan Tengah", slug: "kalimantan-tengah", logo: "/assets/polda/polda-kalteng.png" }, { name: "Polda Kalimantan Selatan", slug: "kalimantan-selatan", logo: "/assets/polda/polda-kalsel.png" }, { name: "Polda Kalimantan Timur", slug: "kalimantan-timur", logo: "/assets/polda/polda-kaltim.png" }, - { name: "Polda Kalimantan Utara", slug: "kalimantan-utara", logo: "/assets/polda/polda-kalut.png" }, + { name: "Polda Kalimantan Utara", slug: "kaltara", logo: "/assets/polda/polda-kalut.png" }, { name: "Polda Sulawesi Tengah", slug: "sulawesi-tengah", logo: "/assets/polda/polda-sulteng.png" }, { name: "Polda Sulawesi Utara", slug: "sulawesi-utara", logo: "/assets/polda/polda-sulut.png" }, { name: "Polda Gorontalo", slug: "gorontalo", logo: "/assets/polda/polda-gorontalo.png" }, @@ -60,80 +60,55 @@ const Coverage: React.FC = () => { }; return ( -
- - {/* Header */} -

- {pathname?.split("/")[1] == "in" ? ( - <> - {t("coverageOnly")} {t("area")}{" "} - - ) : ( - <> - {t("area")}  - {t("coverageOnly")} - - )} -

+
+ {/* Header */} + {/*

+ {pathname?.split("/")[1] == "in" ? ( + <> + {t("coverageOnly")} {t("area")}{" "} + + ) : ( + <> + {t("area")}  + {t("coverageOnly")} + + )} +

*/} - {/*

+ {/*

Liputan Wilayah

*/} -
+ {/*
*/} - {/* Pencarian */} -
- setSearchTerm(e.target.value)} type="text" placeholder={t("search")} className="w-4/5 px-4 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-[#bb3523] focus:outline-none" /> - + {/* Pencarian */} + {/*
+ setSearchTerm(e.target.value)} type="text" placeholder={t("search")} className="w-4/5 px-4 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-[#bb3523] focus:outline-none" /> + +
*/} + + {/* Grid Wilayah */} +
+ {filteredList?.map((region: any) => ( + +
+ {region.name} +
+

{region.name}

+ + ))} +
+ + {/* {filteredList && filteredList.length > 9 && ( +
+
- - {/* Grid Wilayah */} -
-
- - polda-kaltara - -

Polda Kalimantan Utara

-
- {filteredList && filteredList.length > 0 ? ( - filteredList.map((region, index) => - !seeAllValue ? ( - index < 8 ? ( - -
- {region.name} -
-

{region.name}

- - ) : ( - "" - ) - ) : ( - -
- {region.name} -
-

{region.name}

- - ) - ) - ) : ( -

{t("notFound")}

- )} -
- - {filteredList && filteredList.length > 8 && ( -
- -
- )} - + )} */}
); }; diff --git a/components/landing-page/division.tsx b/components/landing-page/division.tsx index 714a3d5b..f4479d11 100644 --- a/components/landing-page/division.tsx +++ b/components/landing-page/division.tsx @@ -65,8 +65,8 @@ const Division = () => { return (
{/* Header */} - -

+ {/* */} + {/*

{pathname?.split("/")[1] == "in" ? ( <> {t("coverageOnly")} {t("division")}{" "} @@ -77,54 +77,37 @@ const Division = () => { {t("coverageOnly")} )} -

-
+

*/} + {/*
*/} - {/* Pencarian */} -
+ {/* Pencarian */} + {/*
setSearchTerm(e.target.value)} type="text" placeholder={t("search")} className="w-4/5 px-4 py-2 border border-gray-300 rounded-md focus:ring-2 focus:ring-[#bb3523] focus:outline-none" /> -
+
*/} - {/* Grid Wilayah */} -
- {filteredList && filteredList.length > 0 ? ( - filteredList.map((region, index) => - !seeAllValue ? ( - index < 7 ? ( - -
- {region.name} -
-

{region.name}

- - ) : ( - "" - ) - ) : ( - -
- {region.name} -
-

{region.name}

- - ) - ) - ) : ( -

Satker Tidak Ditemukan

- )} -
- {filteredList && filteredList.length > 9 && ( + {/* Grid Wilayah */} +
+ {filteredList?.map((region: any) => ( + +
+ {region.name} +
+

{region.name}

+ + ))} +
+ {/* {filteredList && filteredList.length > 9 && (
- )} -
+ )} */} + {/* */}
); }; diff --git a/components/landing-page/hero.tsx b/components/landing-page/hero.tsx index 8ae450cb..b23dfcbe 100644 --- a/components/landing-page/hero.tsx +++ b/components/landing-page/hero.tsx @@ -52,7 +52,7 @@ const Hero: React.FC = () => { console.log(response); setHeroData(response?.data?.data?.content); }; - + return (
{/* Section Gambar Utama */} @@ -74,9 +74,9 @@ const Hero: React.FC = () => {
{list?.categoryName} -

{list?.title}

+

{list?.title}

-

+

{formatDateToIndonesian(new Date(list?.createdAt))} {list?.timezone ? list?.timezone : "WIB"}|{" "} +

{t("breakingNews")}
diff --git a/public/assets/indo.png b/public/assets/indo.png new file mode 100644 index 00000000..042288fd Binary files /dev/null and b/public/assets/indo.png differ diff --git a/public/assets/logo-polri.png b/public/assets/logo-polri.png new file mode 100644 index 00000000..e68a5334 Binary files /dev/null and b/public/assets/logo-polri.png differ