diff --git a/app/[locale]/(public)/(polda)/polda/[polda_name]/audio/detail/[slug]/page.tsx b/app/[locale]/(public)/(polda)/polda/[polda_name]/audio/detail/[slug]/page.tsx index 3f1e5ddf..46e77a78 100644 --- a/app/[locale]/(public)/(polda)/polda/[polda_name]/audio/detail/[slug]/page.tsx +++ b/app/[locale]/(public)/(polda)/polda/[polda_name]/audio/detail/[slug]/page.tsx @@ -16,6 +16,7 @@ import { checkMaliciousText, getPublicLocaleTimestamp } from "@/utils/globals"; import withReactContent from "sweetalert2-react-content"; import Swal from "sweetalert2"; import parse from "html-react-parser"; +import { postActivityLog } from "@/service/content/content"; const DetailAudio = () => { @@ -47,6 +48,7 @@ const DetailAudio = () => { useEffect(() => { initFetch(); checkWishlist(); + sendActivityLog(2); }, []); const initFetch = async () => { @@ -131,8 +133,7 @@ const DetailAudio = () => { url: window.location.href, }; // set activity - // const response = await postActivityLog(data, token); - // console.log(response); + await postActivityLog(data); } const handleDownload = () => { diff --git a/app/[locale]/(public)/(polda)/polda/[polda_name]/document/detail/[slug]/page.tsx b/app/[locale]/(public)/(polda)/polda/[polda_name]/document/detail/[slug]/page.tsx index 0c0e9ecc..c3f4d657 100644 --- a/app/[locale]/(public)/(polda)/polda/[polda_name]/document/detail/[slug]/page.tsx +++ b/app/[locale]/(public)/(polda)/polda/[polda_name]/document/detail/[slug]/page.tsx @@ -20,6 +20,7 @@ import { Button } from "@/components/ui/button"; import { useSearchParams } from "next/navigation"; import { sendMediaUploadToEmail } from "@/service/media-tracking/media-tracking"; import parse from "html-react-parser"; +import { postActivityLog } from "@/service/content/content"; const DetailDocument = () => { const [selectedSize, setSelectedSize] = useState("L"); @@ -59,6 +60,7 @@ const DetailDocument = () => { useEffect(() => { initFetch(); checkWishlist(); + sendActivityLog(2); }, []); const initFetch = async () => { @@ -151,8 +153,7 @@ const DetailDocument = () => { url: window.location.href, }; // set activity - // const response = await postActivityLog(data, token); - // console.log(response); + await postActivityLog(data); } const handleDownload = () => { diff --git a/app/[locale]/(public)/(polda)/polda/[polda_name]/image/detail/[slug]/page.tsx b/app/[locale]/(public)/(polda)/polda/[polda_name]/image/detail/[slug]/page.tsx index 02be3577..1fcb2322 100644 --- a/app/[locale]/(public)/(polda)/polda/[polda_name]/image/detail/[slug]/page.tsx +++ b/app/[locale]/(public)/(polda)/polda/[polda_name]/image/detail/[slug]/page.tsx @@ -17,6 +17,7 @@ import withReactContent from "sweetalert2-react-content"; import Swal from "sweetalert2"; import { useSearchParams } from "next/navigation"; import parse from "html-react-parser"; +import { postActivityLog } from "@/service/content/content"; const DetailInfo = () => { const MySwal = withReactContent(Swal); @@ -57,6 +58,7 @@ const DetailInfo = () => { useEffect(() => { initFetch(); checkWishlist(); + sendActivityLog(2); }, []); const initFetch = async () => { @@ -155,8 +157,7 @@ const DetailInfo = () => { url: window.location.href, }; // set activity - // const response = await postActivityLog(data, token); - // console.log(response); + await postActivityLog(data); } function addDefaultProfile(ev: any) { diff --git a/app/[locale]/(public)/(polda)/polda/[polda_name]/page.tsx b/app/[locale]/(public)/(polda)/polda/[polda_name]/page.tsx index 4f18ade0..e7c51e8c 100644 --- a/app/[locale]/(public)/(polda)/polda/[polda_name]/page.tsx +++ b/app/[locale]/(public)/(polda)/polda/[polda_name]/page.tsx @@ -20,7 +20,8 @@ const page = () => {
- + {/* */} + diff --git a/app/[locale]/(public)/(polda)/polda/[polda_name]/video/detail/[slug]/page.tsx b/app/[locale]/(public)/(polda)/polda/[polda_name]/video/detail/[slug]/page.tsx index d993ec4e..f5f7637f 100644 --- a/app/[locale]/(public)/(polda)/polda/[polda_name]/video/detail/[slug]/page.tsx +++ b/app/[locale]/(public)/(polda)/polda/[polda_name]/video/detail/[slug]/page.tsx @@ -11,6 +11,7 @@ import { Textarea } from "@/components/ui/textarea"; import { getCookiesDecrypt } from "@/lib/utils"; import { close, error, loading } from "@/config/swal"; import { useToast } from "@/components/ui/use-toast"; +import { postActivityLog } from "@/service/content/content"; const DetailVideo = () => { const [selectedSize, setSelectedSize] = useState("L"); @@ -34,6 +35,7 @@ const DetailVideo = () => { useEffect(() => { initFetch(); checkWishlist(); + sendActivityLog(2); }, []); const initFetch = async () => { @@ -126,8 +128,7 @@ const DetailVideo = () => { url: window.location.href, }; // set activity - // const response = await postActivityLog(data, token); - // console.log(response); + await postActivityLog(data); } const handleDownload = () => { diff --git a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/image/detail/[slug]/page.tsx b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/image/detail/[slug]/page.tsx index 84bcd98a..a0a0da29 100644 --- a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/image/detail/[slug]/page.tsx +++ b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/image/detail/[slug]/page.tsx @@ -160,6 +160,7 @@ import parse from "html-react-parser"; import { Skeleton } from "@/components/ui/skeleton"; import { useTranslations } from "next-intl"; import Image from "next/image"; +import { postActivityLog } from "@/service/content/content"; interface Size { label: string; @@ -215,6 +216,7 @@ const DetailInfo = () => { useEffect(() => { initFetch(); checkWishlist(); + sendActivityLog(2); }, []); const initFetch = async () => { @@ -333,8 +335,7 @@ const DetailInfo = () => { url: window.location.href, }; // set activity - // const response = await postActivityLog(data, token); - // console.log(response); + await postActivityLog(data); } const handleDownload = () => { diff --git a/app/[locale]/(public)/(satker)/satker/[satker_name]/audio/detail/[slug]/page.tsx b/app/[locale]/(public)/(satker)/satker/[satker_name]/audio/detail/[slug]/page.tsx index 0926b251..12999527 100644 --- a/app/[locale]/(public)/(satker)/satker/[satker_name]/audio/detail/[slug]/page.tsx +++ b/app/[locale]/(public)/(satker)/satker/[satker_name]/audio/detail/[slug]/page.tsx @@ -11,6 +11,7 @@ import { useToast } from "@/components/ui/use-toast"; import { checkWishlistStatus, deleteWishlist, getDetail, saveWishlist } from "@/service/landing/landing"; import { getCookiesDecrypt } from "@/lib/utils"; import { close, error, loading } from "@/config/swal"; +import { postActivityLog } from "@/service/content/content"; const DetailAudio = () => { const [selectedSize, setSelectedSize] = useState("L"); @@ -35,6 +36,7 @@ const DetailAudio = () => { useEffect(() => { initFetch(); checkWishlist(); + sendActivityLog(2); }, []); const initFetch = async () => { @@ -119,8 +121,7 @@ const DetailAudio = () => { url: window.location.href, }; // set activity - // const response = await postActivityLog(data, token); - // console.log(response); + await postActivityLog(data); } const handleDownload = () => { diff --git a/app/[locale]/(public)/(satker)/satker/[satker_name]/document/detail/[slug]/page.tsx b/app/[locale]/(public)/(satker)/satker/[satker_name]/document/detail/[slug]/page.tsx index 45792ef2..b9117d4f 100644 --- a/app/[locale]/(public)/(satker)/satker/[satker_name]/document/detail/[slug]/page.tsx +++ b/app/[locale]/(public)/(satker)/satker/[satker_name]/document/detail/[slug]/page.tsx @@ -10,6 +10,7 @@ import { checkWishlistStatus, deleteWishlist, getDetail, saveWishlist } from "@/ import { close, error, loading } from "@/config/swal"; import { useToast } from "@/components/ui/use-toast"; import { Link, useRouter } from "@/i18n/routing"; +import { postActivityLog } from "@/service/content/content"; const DetailDocument = () => { const [selectedSize, setSelectedSize] = useState("L"); @@ -35,6 +36,7 @@ const DetailDocument = () => { useEffect(() => { initFetch(); checkWishlist(); + sendActivityLog(2); }, []); const initFetch = async () => { @@ -127,8 +129,7 @@ const DetailDocument = () => { url: window.location.href, }; // set activity - // const response = await postActivityLog(data, token); - // console.log(response); + await postActivityLog(data); } const handleDownload = () => { diff --git a/app/[locale]/(public)/(satker)/satker/[satker_name]/image/detail/[slug]/page.tsx b/app/[locale]/(public)/(satker)/satker/[satker_name]/image/detail/[slug]/page.tsx index aa899d42..ab1460c1 100644 --- a/app/[locale]/(public)/(satker)/satker/[satker_name]/image/detail/[slug]/page.tsx +++ b/app/[locale]/(public)/(satker)/satker/[satker_name]/image/detail/[slug]/page.tsx @@ -10,6 +10,7 @@ import { getCookiesDecrypt } from "@/lib/utils"; import { close, error, loading } from "@/config/swal"; import { checkWishlistStatus, deleteWishlist, getDetail, saveWishlist } from "@/service/landing/landing"; import { Link, useRouter } from "@/i18n/routing"; +import { postActivityLog } from "@/service/content/content"; const DetailInfo = () => { const [selectedSize, setSelectedSize] = useState("L"); @@ -35,6 +36,7 @@ const DetailInfo = () => { useEffect(() => { initFetch(); checkWishlist(); + sendActivityLog(2); }, []); const initFetch = async () => { @@ -127,7 +129,7 @@ const DetailInfo = () => { url: window.location.href, }; // set activity - // const response = await postActivityLog(data, token); + await postActivityLog(data); // console.log(response); } diff --git a/app/[locale]/(public)/(satker)/satker/[satker_name]/video/detail/[slug]/page.tsx b/app/[locale]/(public)/(satker)/satker/[satker_name]/video/detail/[slug]/page.tsx index 335ee69f..8f6d744c 100644 --- a/app/[locale]/(public)/(satker)/satker/[satker_name]/video/detail/[slug]/page.tsx +++ b/app/[locale]/(public)/(satker)/satker/[satker_name]/video/detail/[slug]/page.tsx @@ -11,6 +11,7 @@ import { Textarea } from "@/components/ui/textarea"; import { getCookiesDecrypt } from "@/lib/utils"; import { close, error, loading } from "@/config/swal"; import { useToast } from "@/components/ui/use-toast"; +import { postActivityLog } from "@/service/content/content"; const DetailVideo = () => { const [selectedSize, setSelectedSize] = useState("L"); @@ -34,6 +35,7 @@ const DetailVideo = () => { useEffect(() => { initFetch(); checkWishlist(); + sendActivityLog(2); }, []); const initFetch = async () => { @@ -126,8 +128,7 @@ const DetailVideo = () => { url: window.location.href, }; // set activity - // const response = await postActivityLog(data, token); - // console.log(response); + postActivityLog(data); } const handleDownload = () => { diff --git a/app/[locale]/(public)/audio/detail/[slug]/page.tsx b/app/[locale]/(public)/audio/detail/[slug]/page.tsx index 1cf117e1..143cb1c7 100644 --- a/app/[locale]/(public)/audio/detail/[slug]/page.tsx +++ b/app/[locale]/(public)/audio/detail/[slug]/page.tsx @@ -21,6 +21,7 @@ import { checkMaliciousText, formatDateToIndonesian, getPublicLocaleTimestamp } import parse from "html-react-parser"; import $ from "jquery"; import { useTranslations } from "next-intl"; +import { postActivityLog } from "@/service/content/content"; const formWaveSurferOptions = (ref: any) => ({ container: ref, @@ -74,6 +75,7 @@ const DetailAudio = () => { useEffect(() => { initFetch(); checkWishlist(); + sendActivityLog(2); }, []); const initFetch = async () => { @@ -163,8 +165,7 @@ const DetailAudio = () => { url: window.location.href, }; // set activity - // const response = await postActivityLog(data, token); - // console.log(response); + await postActivityLog(data); } const handleDownload = () => { diff --git a/app/[locale]/(public)/document/detail/[slug]/page.tsx b/app/[locale]/(public)/document/detail/[slug]/page.tsx index a9d3a4ce..c777388c 100644 --- a/app/[locale]/(public)/document/detail/[slug]/page.tsx +++ b/app/[locale]/(public)/document/detail/[slug]/page.tsx @@ -19,6 +19,7 @@ import withReactContent from "sweetalert2-react-content"; import Swal from "sweetalert2"; import parse from "html-react-parser"; import { useTranslations } from "next-intl"; +import { postActivityLog } from "@/service/content/content"; const DetailDocument = () => { const [selectedSize, setSelectedSize] = useState("L"); @@ -58,6 +59,7 @@ const DetailDocument = () => { useEffect(() => { initFetch(); checkWishlist(); + sendActivityLog(2); }, []); const initFetch = async () => { @@ -161,8 +163,7 @@ const DetailDocument = () => { url: window.location.href, }; // set activity - // const response = await postActivityLog(data, token); - // console.log(response); + await postActivityLog(data); } const handleDownload = () => { diff --git a/app/[locale]/(public)/image/detail/[slug]/page.tsx b/app/[locale]/(public)/image/detail/[slug]/page.tsx index bd7b3e1d..44e9748c 100644 --- a/app/[locale]/(public)/image/detail/[slug]/page.tsx +++ b/app/[locale]/(public)/image/detail/[slug]/page.tsx @@ -37,6 +37,7 @@ import parse from "html-react-parser"; import { Skeleton } from "@/components/ui/skeleton"; import { useTranslations } from "next-intl"; import Image from "next/image"; +import { postActivityLog } from "@/service/content/content"; interface Size { label: string; @@ -96,6 +97,7 @@ const DetailInfo = () => { useEffect(() => { initFetch(); checkWishlist(); + sendActivityLog(2); }, []); const initFetch = async () => { @@ -214,8 +216,7 @@ const DetailInfo = () => { url: window.location.href, }; // set activity - // const response = await postActivityLog(data, token); - // console.log(response); + await postActivityLog(data); } const handleDownload = () => { diff --git a/app/[locale]/(public)/video/detail/[slug]/page.tsx b/app/[locale]/(public)/video/detail/[slug]/page.tsx index a02a0e84..171bfb9b 100644 --- a/app/[locale]/(public)/video/detail/[slug]/page.tsx +++ b/app/[locale]/(public)/video/detail/[slug]/page.tsx @@ -21,6 +21,7 @@ import Swal from "sweetalert2"; import parse from "html-react-parser"; import { useTranslations } from "next-intl"; import Image from "next/image"; +import { postActivityLog } from "@/service/content/content"; interface Size { label: string; @@ -62,6 +63,7 @@ const DetailVideo = () => { useEffect(() => { initFetch(); checkWishlist(); + sendActivityLog(2); }, []); const initFetch = async () => { @@ -158,8 +160,7 @@ const DetailVideo = () => { url: window.location.href, }; // set activity - // const response = await postActivityLog(data, token); - // console.log(response); + await postActivityLog(data); } const handleDownload = () => { diff --git a/app/[locale]/layout.tsx b/app/[locale]/layout.tsx index 6ffd9dc2..72fd5a5c 100644 --- a/app/[locale]/layout.tsx +++ b/app/[locale]/layout.tsx @@ -13,6 +13,7 @@ import { NextIntlClientProvider } from "next-intl"; import { getMessages } from "next-intl/server"; import DirectionProvider from "@/providers/direction-provider"; import AuthProvider from "@/providers/auth.provider"; +import LoadScript from "@/utils/globals"; export const metadata: Metadata = { title: "Media Hub | POLRI", @@ -34,6 +35,7 @@ export default async function RootLayout({ + diff --git a/components/landing-page/content-category.tsx b/components/landing-page/content-category.tsx index 3dc3a032..842b550f 100644 --- a/components/landing-page/content-category.tsx +++ b/components/landing-page/content-category.tsx @@ -1,7 +1,4 @@ -import { - getCategoryData, - getPublicCategoryData, -} from "@/service/landing/landing"; +import { getCategoryData, getPublicCategoryData } from "@/service/landing/landing"; import Link from "next/link"; import React, { useEffect, useState } from "react"; import { Button } from "../ui/button"; @@ -10,6 +7,8 @@ import { useTranslations } from "next-intl"; import { usePathname } from "next/navigation"; import { useParams } from "next/navigation"; import Image from "next/image"; +import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious } from "../ui/carousel"; +import { useRouter } from "@/i18n/routing"; const ContentCategory = (props: { group?: string }) => { const [categories, setCategories] = useState(); @@ -18,21 +17,16 @@ const ContentCategory = (props: { group?: string }) => { const locale = params?.locale; const poldaName = params?.polda_name; const satkerName = params?.satker_name; + const router = useRouter(); + + let prefixPath = poldaName ? `/polda/${poldaName}` : satkerName ? `/satker/${satkerName}` : "/"; useEffect(() => { initFetch(); }, []); const initFetch = async () => { const response = await getPublicCategoryData( - props.group == "mabes" - ? "" - : props.group == "polda" && poldaName && String(poldaName)?.length > 1 - ? poldaName - : props.group == "satker" && - satkerName && - String(satkerName)?.length > 1 - ? "satker-" + satkerName - : "", + props.group == "mabes" ? "" : props.group == "polda" && poldaName && String(poldaName)?.length > 1 ? poldaName : props.group == "satker" && satkerName && String(satkerName)?.length > 1 ? "satker-" + satkerName : "", "", locale == "en" ? true : false ); @@ -58,16 +52,13 @@ const ContentCategory = (props: { group?: string }) => { `; - const toBase64 = (str: string) => - typeof window === "undefined" - ? Buffer.from(str).toString("base64") - : window.btoa(str); + const toBase64 = (str: string) => (typeof window === "undefined" ? Buffer.from(str).toString("base64") : window.btoa(str)); return (
-

- {/* {pathname?.split("/")[1] == "in" ? ( +

+ {pathname?.split("/")[1] == "in" ? ( <> {t("category")}  {t("content")} @@ -77,109 +68,53 @@ const ContentCategory = (props: { group?: string }) => { {t("content")}  {t("category")} - )} */} - Kategori Konten -

- {/*
*/} - -
- {categories?.map((category: any, index: number) => - !seeAllValue ? ( - index < 4 ? ( - // - // category - //
- //

{category?.name}

- //
- // - - {/* Gambar */} - category - - {/* Overlay gelap */} -
- - {/* Judul */} -
-

- {category?.name} -

-
- - ) : ( - "" - ) - ) : ( - // - // category - //
- //

{category?.name}

- //
- // - - {/* Gambar */} - category - - {/* Overlay Gelap */} -
- - {/* Judul */} -
-

- {category?.name} -

-
- - ) )} + +
+ +
+ + + {categories?.map((category: any) => ( + + + {/* Gambar */} + category + + {/* Overlay gelap */} +
+ + {/* Judul */} +
+

{category?.name}

+
+ +
+ ))} +
+ + +
-
- +
*/} +
+
router.push(prefixPath + `/${selectedTab}/filter?sortBy=${props.type}`)} + className="cursor-pointer border text-[#bb3523] rounded-lg text-sm lg:text-md px-4 py-1 border-[#bb3523]" + > + {t("seeAll")} +
diff --git a/components/landing-page/landing-polda-kaltara/contact-us-kaltara.tsx b/components/landing-page/landing-polda-kaltara/contact-us-kaltara.tsx index 62c07d1c..a7ac9bfb 100644 --- a/components/landing-page/landing-polda-kaltara/contact-us-kaltara.tsx +++ b/components/landing-page/landing-polda-kaltara/contact-us-kaltara.tsx @@ -1,17 +1,72 @@ +import { Button } from "@/components/ui/button"; import { Link } from "@/i18n/routing"; import { Icon } from "@iconify/react/dist/iconify.js"; import Image from "next/image"; import React from "react"; +type Channel = { + name: string; + logo: string; + url: string; +}; + +const channels: Channel[] = [ + { + name: "Divisi Humas Polri", + logo: "/assets/portal-humas.png", + url: "https://portal.humas.polri.go.id/", + }, + { + name: "Media Hub", + logo: "/assets/mediahub-logo.gif", + url: "/polda/kaltara", + }, + { + name: "SPIT", + logo: "/assets/logo-spit.png", + url: "https://spit.humas.polri.go.id/", + }, + { + name: "Polri TV", + logo: "/assets/polriTv.png", + url: "https://tvradio.polri.go.id/", + }, + { + name: "TBNews", + logo: "/assets/img/logo-tbn.png", + url: "/tbnews/polda-kaltara", + }, + { + name: "INP", + logo: "/assets/logo-inp.png", + url: "https://inp.polri.go.id/", + }, +]; + const ContactUsKaltara = () => { return ( -
-
+
+
+

Channel Divisi Humas Polri

+ + {/* Mobile version pakai grid, Desktop pakai flex */} +
+ {channels.map((channel, index) => ( + +
+ {channel.name} +
+ + ))} +
+
+ +
{/* Logo */}
- -

Copyright @TribrataNews Kaltara

+ logo + {/*

Copyright @TribrataNews Kaltara

*/}
{/* Contact Us */} @@ -100,6 +155,14 @@ const ContactUsKaltara = () => { Index
+ + {/* login */} + + +
{/* Social Media */} diff --git a/components/landing-page/landing-polda-kaltara/header-banner-kaltara.tsx b/components/landing-page/landing-polda-kaltara/header-banner-kaltara.tsx index 6a38dbb0..76b03417 100644 --- a/components/landing-page/landing-polda-kaltara/header-banner-kaltara.tsx +++ b/components/landing-page/landing-polda-kaltara/header-banner-kaltara.tsx @@ -3,7 +3,7 @@ import { listData } from "@/service/landing/landing"; import { useParams } from "next/navigation"; import React, { useEffect, useState } from "react"; import Skeleton, { SkeletonTheme } from "react-loading-skeleton"; -import { formatDateToIndonesian, getPublicLocaleTimestamp, textEllipsis } from "@/utils/globals"; +import { formatDateToIndonesian, getPublicLocaleTimestamp } from "@/utils/globals"; import { Icon } from "@iconify/react/dist/iconify.js"; import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious } from "@/components/ui/carousel"; import Image from "next/image"; @@ -75,12 +75,12 @@ const HeaderBannerKaltara = () => { <> {/* Header Left */} -
+
{isBannerLoading ? (
- +
@@ -152,7 +152,7 @@ const HeaderBannerKaltara = () => {
) : ( -
    +
      {content?.map((item: any) => (
    • @@ -161,7 +161,7 @@ const HeaderBannerKaltara = () => {
      {item?.categoryName}
      router.push(prefixPath + `/image/detail/${item?.slug}`)} className="cursor-pointer"> -

      {textEllipsis(item?.title, 30)}

      +

      {item?.title}

      {formatDateToIndonesian(new Date(item?.createdAt))} {item?.timezone ? item?.timezone : "WIB"} |{" "} diff --git a/components/landing-page/landing-polda-kaltara/latest-content-kaltara.tsx b/components/landing-page/landing-polda-kaltara/latest-content-kaltara.tsx index 871451d8..b220be2d 100644 --- a/components/landing-page/landing-polda-kaltara/latest-content-kaltara.tsx +++ b/components/landing-page/landing-polda-kaltara/latest-content-kaltara.tsx @@ -6,7 +6,7 @@ import { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious import Image from "next/image"; import { Skeleton } from "@/components/ui/skeleton"; import { formatDateToIndonesian, secondToTimes } from "@/utils/globals"; -import { useParams } from "next/navigation"; +import { useParams, usePathname } from "next/navigation"; import { listData } from "@/service/landing/landing"; import { useRouter } from "@/i18n/routing"; import { Icon } from "@iconify/react/dist/iconify.js"; @@ -23,6 +23,7 @@ const LatestContentKaltara = (props: { group: string; type: string }) => { const [isBannerLoading, setIsBannerLoading] = useState(true); const [centerPadding, setCenterPadding] = useState(); const router = useRouter(); + const pathname = usePathname(); const t = useTranslations("LandingPage"); let prefixPath = poldaName ? `/polda/${poldaName}` : satkerName ? `/satker/${satkerName}` : "/"; @@ -73,9 +74,22 @@ const LatestContentKaltara = (props: { group: string; type: string }) => { return ( <> -

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

      + {pathname?.split("/")[1] == "in" ? ( + <> + {t("content")}  + {props.type == "popular" ? "Terpopuler" : props.type == "latest" ? t("new") : "Serupa"} + + ) : ( + <> + {props.type == "popular" ? "Popular" : props.type == "latest" ? t("new") : "Serupa"}  + {t("content")} + + )} +

      {
      {selectedTab == "image" ? ( content?.length > 0 ? ( - // - // - // {content?.map((image: any) => ( - // - //
      router.push(prefixPath + `/video/detail/${image?.slug}`)} className="cursor-pointer relative group rounded-md overflow-hidden"> - // {/* Gambar */} - // image - - // {/* Kategori - Sekarang Berada di Atas */} - // {image?.categoryName} - - // {/* Overlay Konten (Informasi di Bawah) */} - //
      - // {/* Judul */} - //

      {image?.title}

      - - // {/* Info Tambahan */} - // {/*

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

      */} - //
      - //
      - //
      - // ))} - //
      - // {/* - // */} - //
      - + {content?.map((image: any) => ( - -
      router.push(prefixPath + `/image/detail/${image?.slug}`)} className="cursor-pointer relative group rounded-md overflow-hidden"> + +
      router.push(prefixPath + `/image/detail/${image?.slug}`)} className="cursor-pointer relative group overflow-hidden shadow-md hover:shadow-lg"> {/* Gambar */} { width={2560} height={1440} src={image?.thumbnailLink} - className="w-full lg:w-[400px] h-48 md:h-56 lg:h-[490px] object-cover rounded-md" + className="w-full rounded-lg h-48 lg:h-60 object-cover group-hover:scale-100 transition-transform duration-300" /> {/* Overlay gelap */}
      - {/* Kategori */} - {image?.categoryName} - - {/* Konten Informasi */} -
      -

      {image?.title}

      +
      +

      {image?.title}

      +

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

      ))} + + ) : (

      @@ -202,10 +182,10 @@ const LatestContentKaltara = (props: { group: string; type: string }) => { ) ) : selectedTab == "audio" ? ( content?.length > 0 ? ( - + {content?.map((audio: any) => ( - +

      router.push(prefixPath + `/audio/detail/${audio?.slug}`)} className="cursor-pointer flex flex-col sm:flex-row items-center bg-white dark:bg-gray-800 shadow-md rounded-lg p-4 gap-4 w-full">
      @@ -230,8 +210,8 @@ const LatestContentKaltara = (props: { group: string; type: string }) => { ))} - {/* - */} + + ) : (

      @@ -240,46 +220,11 @@ const LatestContentKaltara = (props: { group: string; type: string }) => { ) ) : selectedTab == "video" ? ( content?.length > 0 ? ( - // - // - // {content?.map((video: any) => ( - // - //

      router.push(prefixPath + `/video/detail/${video?.slug}`)} className="cursor-pointer relative group rounded-lg overflow-hidden"> - // {/* Gambar */} - // video - - // {/* Kategori - Sekarang Berada di Atas */} - // {video?.categoryName} - - // {/* Overlay Konten (Informasi di Bawah) */} - //
      - // {/* Judul */} - //

      {video?.title}

      - - // {/* Info Tambahan */} - // {/*

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

      */} - //
      - //
      - // - // ))} - // - // {/* - // */} - // - + {content?.map((video: any) => ( - -
      router.push(prefixPath + `/video/detail/${video?.slug}`)} className="cursor-pointer relative group rounded-md overflow-hidden"> + +
      router.push(prefixPath + `/video/detail/${video?.slug}`)} className="cursor-pointer relative group overflow-hidden shadow-md hover:shadow-lg"> {/* Gambar */} { width={2560} height={1440} src={video?.thumbnailLink} - className="w-full lg:w-[400px] h-48 md:h-56 lg:h-[490px] object-cover rounded-md" + className="w-full rounded-lg h-48 lg:h-60 object-cover group-hover:scale-100 transition-transform duration-300" /> {/* Overlay Gelap */}
      - {/* Kategori */} - {video?.categoryName} - - {/* Overlay Konten (Judul) */} -
      -

      {video?.title}

      +
      +

      {video?.title}

      +

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

      ))} + + ) : (

      @@ -311,10 +257,10 @@ const LatestContentKaltara = (props: { group: string; type: string }) => {

      ) ) : content.length > 0 ? ( - + {content?.map((text: any) => ( - +
      router.push(prefixPath + `/document/detail/${text?.slug}`)} className="flex flex-col bg-yellow-500 sm:flex-row items-center dark:bg-gray-800 cursor-pointer shadow-md rounded-lg p-4 gap-4">
      @@ -346,8 +292,8 @@ const LatestContentKaltara = (props: { group: string; type: string }) => { ))} - {/* - */} + + ) : (

      diff --git a/components/landing-page/landing-polda-kaltara/navbar-polda-kaltara.tsx b/components/landing-page/landing-polda-kaltara/navbar-polda-kaltara.tsx index d10b5ea2..29ef441c 100644 --- a/components/landing-page/landing-polda-kaltara/navbar-polda-kaltara.tsx +++ b/components/landing-page/landing-polda-kaltara/navbar-polda-kaltara.tsx @@ -136,8 +136,8 @@ const NavbarKaltara = () => {

      - - TBNews + + logo
      @@ -174,14 +174,6 @@ const NavbarKaltara = () => { {/* Dark Mode */} - - {/* login */} - - -
      @@ -278,7 +270,7 @@ const NavbarKaltara = () => {
      - TBNews + logo
      @@ -317,14 +309,6 @@ const NavbarKaltara = () => { {/* Dark Mode */} - - {/* login */} - - -
      diff --git a/components/landing-page/search-section.tsx b/components/landing-page/search-section.tsx index 0bf06c2e..dffaa6a4 100644 --- a/components/landing-page/search-section.tsx +++ b/components/landing-page/search-section.tsx @@ -1,8 +1,6 @@ import React, { useState } from "react"; -import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../ui/dropdown-menu"; -import { FiFile, FiImage, FiMusic, FiYoutube } from "react-icons/fi"; import { Icon } from "@iconify/react/dist/iconify.js"; -import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue } from "@/components/ui/select"; +import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; import { useRouter } from "@/i18n/routing"; import { useTranslations } from "next-intl"; @@ -13,8 +11,8 @@ const SearchSection = () => { const t = useTranslations("LandingPage"); return ( -
      -
      +
      +
      {/* Heading */}

      {t("exploration")} {t("and")} {t("download")} {t("coverage")}{" "} diff --git a/public/assets/logo-humas-polri.png b/public/assets/logo-humas-polri.png new file mode 100644 index 00000000..ef366bec Binary files /dev/null and b/public/assets/logo-humas-polri.png differ diff --git a/public/assets/logo-inp.png b/public/assets/logo-inp.png new file mode 100644 index 00000000..706a9573 Binary files /dev/null and b/public/assets/logo-inp.png differ diff --git a/public/assets/logo-spit.png b/public/assets/logo-spit.png new file mode 100644 index 00000000..b33f1e1c Binary files /dev/null and b/public/assets/logo-spit.png differ diff --git a/public/assets/polda/logo-tbnews.png b/public/assets/polda/logo-tbnews.png new file mode 100644 index 00000000..dfac2e80 Binary files /dev/null and b/public/assets/polda/logo-tbnews.png differ diff --git a/public/assets/portal-humas.png b/public/assets/portal-humas.png new file mode 100644 index 00000000..0d9a47ca Binary files /dev/null and b/public/assets/portal-humas.png differ diff --git a/service/content/content.ts b/service/content/content.ts index af2da4a4..257c24f1 100644 --- a/service/content/content.ts +++ b/service/content/content.ts @@ -1,3 +1,4 @@ +import { httpPost } from "../http-config/http-base-service"; import { httpDeleteInterceptor, httpGetInterceptor, @@ -225,3 +226,11 @@ export async function deleteSPIT(id: any) { const url = `media/spit?id=${id}`; return httpDeleteInterceptor(url); } + +export async function postActivityLog(data: any) { + const url = `activity`; + const headers = { + "content-type": "application/json", + }; + return httpPost(url, headers, data); +} \ No newline at end of file diff --git a/service/http-config/http-base-service.ts b/service/http-config/http-base-service.ts index 2d4ed979..3290e120 100644 --- a/service/http-config/http-base-service.ts +++ b/service/http-config/http-base-service.ts @@ -7,6 +7,7 @@ import { getCsrfToken } from "../auth"; export async function httpPost(pathUrl: any, headers: any, data?: any) { const resCsrf = await getCsrfToken(); const csrfToken = resCsrf?.data?.token; + const authToken = Cookies.get("access_token"); const defaultHeaders = { "Content-Type": "application/json", @@ -16,6 +17,7 @@ export async function httpPost(pathUrl: any, headers: any, data?: any) { ...defaultHeaders, ...headers, ...(csrfToken ? { "X-XSRF-TOKEN": csrfToken } : {}), + ...(authToken ? { "Authorization" : `Bearer ${authToken}`} : {}), }; const response = await axiosBaseInstance diff --git a/utils/globals.tsx b/utils/globals.tsx index 11019f6d..81def301 100644 --- a/utils/globals.tsx +++ b/utils/globals.tsx @@ -1,5 +1,8 @@ +"use client"; + import { format } from "date-fns"; import { id, tr } from "date-fns/locale"; +import { useEffect } from "react"; export const generateLocalizedPath = (href: string, locale: string): string => { if (href.startsWith(`/${locale}`)) { @@ -153,3 +156,19 @@ export const shimmer = (w: number, h: number) => ` `; export const toBase64 = (str: string) => (typeof window === "undefined" ? Buffer.from(str).toString("base64") : window.btoa(str)); + +const LoadScript = () => { + useEffect(() => { + const script = document.createElement("script"); + script.src = "https://cdn.userway.org/widget.js"; + script.setAttribute("data-account", "X36s1DpjqB"); + script.async = true; + document.head.appendChild(script); + return () => { + // Cleanup if needed + document.head.removeChild(script); + }; + }, []); + return null; // Tidak perlu merender apa-apa +}; +export default LoadScript;