From 13f25f94a7c6b104b4175fd1d9edae7654c57d84 Mon Sep 17 00:00:00 2001 From: hanif salafi Date: Wed, 11 Jun 2025 10:47:52 +0700 Subject: [PATCH] feat : update mediahub international on landing and approver --- .../content/image/components/table-image.tsx | 8 ++++-- .../[polda_name]/components/national-news.tsx | 3 +-- .../components/news-tickers-kaltara.tsx | 2 +- .../[polda_name]/components/popular-news.tsx | 2 +- .../[polda_name]/components/regional-news.tsx | 3 +-- components/form/content/image-detail-form.tsx | 4 +-- .../landing-page/header-banner-satker.tsx | 3 ++- components/landing-page/header-banner.tsx | 3 ++- components/landing-page/hero-new-polda.tsx | 6 ++--- components/landing-page/hero-new-satker.tsx | 6 ++--- components/landing-page/hero-new.tsx | 8 +++--- components/landing-page/hero.tsx | 9 ++++--- components/landing-page/news-tickers.tsx | 7 ++++- .../landing-page/scrollable-content-polda.tsx | 2 +- .../scrollable-content-satker.tsx | 2 +- .../landing-page/search-section-new.tsx | 4 ++- components/partials/auth/login-form.tsx | 3 ++- lib/menus.ts | 6 ++--- service/content/content.ts | 27 ++++++++++--------- service/landing/landing.ts | 4 +-- 20 files changed, 64 insertions(+), 48 deletions(-) diff --git a/app/[locale]/(protected)/contributor/content/image/components/table-image.tsx b/app/[locale]/(protected)/contributor/content/image/components/table-image.tsx index 1e319486..1399f44c 100644 --- a/app/[locale]/(protected)/contributor/content/image/components/table-image.tsx +++ b/app/[locale]/(protected)/contributor/content/image/components/table-image.tsx @@ -52,7 +52,7 @@ import { InputGroup, InputGroupText } from "@/components/ui/input-group"; import { paginationBlog } from "@/service/blog/blog"; import { ticketingPagination } from "@/service/ticketing/ticketing"; import { Badge } from "@/components/ui/badge"; -import { useRouter, useSearchParams } from "next/navigation"; +import { useParams, useRouter, useSearchParams } from "next/navigation"; import TablePagination from "@/components/table/table-pagination"; import { @@ -73,6 +73,9 @@ import useTableColumns from "./columns"; const TableImage = () => { const router = useRouter(); const searchParams = useSearchParams(); + + const params = useParams(); + const locale = params?.locale; const MySwal = withReactContent(Swal); const [dataTable, setDataTable] = React.useState([]); const [totalData, setTotalData] = React.useState(1); @@ -199,7 +202,8 @@ const TableImage = () => { formattedStartDate, // Pastikan format sesuai formattedEndDate, // Pastikan format sesuai search, - filterByCreatorGroup + filterByCreatorGroup, + locale == "en" ); const data = res?.data?.data; 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 index 85a067be..c94dea4b 100644 --- a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/national-news.tsx +++ b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/national-news.tsx @@ -2,8 +2,7 @@ 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 { listData } from "@/service/landing/landing"; import Image from "next/image"; import { useParams } from "next/navigation"; import React, { useEffect, useState } from "react"; diff --git a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/news-tickers-kaltara.tsx b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/news-tickers-kaltara.tsx index 9cd499d7..18ea033a 100644 --- a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/news-tickers-kaltara.tsx +++ b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/news-tickers-kaltara.tsx @@ -1,6 +1,6 @@ "use client"; import { Link } from "@/i18n/routing"; -import { getHeroData, listCarousel, listData } from "@/service/landing/landing"; +import { listData } from "@/service/landing/landing"; import { formatDateToIndonesian, textEllipsis } from "@/utils/globals"; import { useEffect, useState } from "react"; import { useTranslations } from "next-intl"; diff --git a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/popular-news.tsx b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/popular-news.tsx index 4a4c7cd4..b2fc51ff 100644 --- a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/popular-news.tsx +++ b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/popular-news.tsx @@ -44,7 +44,7 @@ const PopularNews = () => { }, []); const initFetch = async () => { - const response = await getHeroData(); + const response = await getHeroData(locale == "en"); console.log(response); setHeroData(response?.data?.data?.content); }; 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 index dd676e45..65b6ddd7 100644 --- a/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/regional-news.tsx +++ b/app/[locale]/(public)/(polda)/tbnews/[polda_name]/components/regional-news.tsx @@ -2,8 +2,7 @@ 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 { listData } from "@/service/landing/landing"; import Image from "next/image"; import { useParams } from "next/navigation"; import React, { useEffect, useState } from "react"; diff --git a/components/form/content/image-detail-form.tsx b/components/form/content/image-detail-form.tsx index 9ff0264a..f7eda88b 100644 --- a/components/form/content/image-detail-form.tsx +++ b/components/form/content/image-detail-form.tsx @@ -683,7 +683,7 @@ export default function FormImageDetail() { "" )} */} - {detail?.isPublish == false && detail.isPublishOnPolda == true ? ( + {(detail?.isPublish == false && detail.isPublishOnPolda == true) || (detail?.isPublish == false && detail?.isInternationalMedia == true && Number(detail?.statusId) == 2) ? (