From d4710352460e92b8b905dfa043be7bb41a820b7e Mon Sep 17 00:00:00 2001
From: Sabda Yagra
Date: Tue, 16 Sep 2025 08:54:05 +0700
Subject: [PATCH 01/10] fix: detail video polda
---
.../(polda)/polda/[polda_name]/video/detail/[slug]/page.tsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 47ef7e70..5b34f589 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
@@ -241,7 +241,7 @@ const DetailVideo = () => {
url={detailDataVideo?.files[selectedVideo]?.url}
/> */}
From d9475cc0a97d92dd95c9ba66d187145df881bb6a Mon Sep 17 00:00:00 2001
From: Sabda Yagra
Date: Tue, 16 Sep 2025 20:00:48 +0700
Subject: [PATCH 02/10] fix: logic download in image detail
---
components/main/image-detail.tsx | 53 +++++++++++++++++++++++++++++---
1 file changed, 49 insertions(+), 4 deletions(-)
diff --git a/components/main/image-detail.tsx b/components/main/image-detail.tsx
index 38aa87a8..90dba4de 100644
--- a/components/main/image-detail.tsx
+++ b/components/main/image-detail.tsx
@@ -272,6 +272,47 @@ const DetailImage = (data: any) => {
// }
// };
+ // const handleDownload = () => {
+ // if (downloadProgress !== 0) return;
+
+ // if (!imageSizeSelected) {
+ // alert("Please select an image size before downloading.");
+ // return;
+ // }
+
+ // if (!userId) {
+ // router.push("/auth");
+ // return;
+ // }
+
+ // sendActivityLog(2);
+ // sendActivityLog(3);
+
+ // if (isDownloadAll) {
+ // const baseId = slug.split("-")?.[0];
+ // const url = `${process.env.NEXT_PUBLIC_API}/media/file/download-zip?id=${baseId}&resolution=${imageSizeSelected}`;
+ // downloadFile(url, "FileDownload.zip");
+ // } else {
+ // const selectedFile = detailDataImage?.files?.[selectedImage];
+
+ // if (!selectedFile) {
+ // toast({
+ // description: "Gambar tidak ditemukan.",
+ // variant: "destructive",
+ // });
+ // return;
+ // }
+
+ // if (isFromSPIT && main?.url?.includes("spit.humas")) {
+ // // downloadFile(selectedFile.url, selectedFile.names || "image.jpg");
+ // downloadFile(`${main?.url}`, `${main.names}`);
+ // } else {
+ // const url = `${process.env.NEXT_PUBLIC_API}/media/view?id=${selectedFile.id}&operation=file&type=image&resolution=${imageSizeSelected}`;
+ // downloadFile(`${main?.url}`, `${main.names}`);
+ // }
+ // }
+ // };
+
const handleDownload = () => {
if (downloadProgress !== 0) return;
@@ -303,12 +344,16 @@ const DetailImage = (data: any) => {
return;
}
- if (isFromSPIT && main?.url?.includes("spit.humas")) {
- // downloadFile(selectedFile.url, selectedFile.names || "image.jpg");
- downloadFile(`${main?.url}`, `${main.names}`);
+ if (isFromSPIT && selectedFile?.url?.includes("spit.humas")) {
+ // ambil url asli dari SPIT, tapi nama file dari judul (main.names)
+ downloadFile(
+ selectedFile.url,
+ main?.names || detailDataImage?.title || "image"
+ );
} else {
const url = `${process.env.NEXT_PUBLIC_API}/media/view?id=${selectedFile.id}&operation=file&type=image&resolution=${imageSizeSelected}`;
- downloadFile(`${main?.url}`, `${main.names}`);
+ // ambil file sesuai yang dipilih, nama tetap dari judul (main.names)
+ downloadFile(url, main?.names || detailDataImage?.title || "image");
}
}
};
From 6fc2dd70af88f7b9d585eade94deef6933e2428e Mon Sep 17 00:00:00 2001
From: hanif salafi
Date: Thu, 18 Sep 2025 20:53:25 +0700
Subject: [PATCH 03/10] feat: update regional list path
---
app/[locale]/(public)/regional/filter/page.tsx | 5 +++++
components/landing-page/filter-all/audio-filter-card.tsx | 4 +++-
components/landing-page/filter-all/document-filter-card.tsx | 4 +++-
components/landing-page/filter-all/image-filter-card.tsx | 4 +++-
components/landing-page/filter-all/video-filter-card.tsx | 5 +++--
5 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/app/[locale]/(public)/regional/filter/page.tsx b/app/[locale]/(public)/regional/filter/page.tsx
index 06965b6b..9bd664da 100644
--- a/app/[locale]/(public)/regional/filter/page.tsx
+++ b/app/[locale]/(public)/regional/filter/page.tsx
@@ -713,6 +713,7 @@ export default function FilterPage() {
startDateString={startDateString}
endDateString={endDateString}
monthYearFilter={monthYearFilter}
+ isRegionalCall={true}
/>
diff --git a/components/landing-page/filter-all/audio-filter-card.tsx b/components/landing-page/filter-all/audio-filter-card.tsx
index fbe34477..b1140454 100644
--- a/components/landing-page/filter-all/audio-filter-card.tsx
+++ b/components/landing-page/filter-all/audio-filter-card.tsx
@@ -22,6 +22,7 @@ export default function FilterAudioComponent(props: {
startDateString?: string;
endDateString?: string;
monthYearFilter?: any;
+ isRegionalCall?: any;
}) {
const {
categoryFilter,
@@ -29,6 +30,7 @@ export default function FilterAudioComponent(props: {
startDateString,
endDateString,
monthYearFilter,
+ isRegionalCall,
} = props;
const [newContent, setNewContent] = useState();
const asPath = usePathname();
@@ -42,7 +44,7 @@ export default function FilterAudioComponent(props: {
const categorie = searchParams?.get("category");
const group = searchParams?.get("group");
const [totalContent, setTotalContent] = useState();
- const isRegional = group || asPath.includes("/polda/");
+ const isRegional = isRegionalCall || group || asPath.includes("/polda/");
const searchType = isRegional ? "regional" : "filter";
const router = useRouter();
const poldaName = params?.polda_name;
diff --git a/components/landing-page/filter-all/document-filter-card.tsx b/components/landing-page/filter-all/document-filter-card.tsx
index be4006f7..550a125f 100644
--- a/components/landing-page/filter-all/document-filter-card.tsx
+++ b/components/landing-page/filter-all/document-filter-card.tsx
@@ -22,6 +22,7 @@ export default function FilterDocumentComponent(props: {
startDateString?: string;
endDateString?: string;
monthYearFilter?: any;
+ isRegionalCall?: any;
}) {
const {
categoryFilter,
@@ -29,6 +30,7 @@ export default function FilterDocumentComponent(props: {
startDateString,
endDateString,
monthYearFilter,
+ isRegionalCall,
} = props;
const [newContent, setNewContent] = useState();
const asPath = usePathname();
@@ -42,7 +44,7 @@ export default function FilterDocumentComponent(props: {
const categorie = searchParams?.get("category");
const group = searchParams?.get("group");
const [totalContent, setTotalContent] = useState();
- const isRegional = group || asPath.includes("/polda/");
+ const isRegional = isRegionalCall || group || asPath.includes("/polda/");
const searchType = isRegional ? "regional" : "filter";
const router = useRouter();
diff --git a/components/landing-page/filter-all/image-filter-card.tsx b/components/landing-page/filter-all/image-filter-card.tsx
index 40743fd7..adb9f7a2 100644
--- a/components/landing-page/filter-all/image-filter-card.tsx
+++ b/components/landing-page/filter-all/image-filter-card.tsx
@@ -21,6 +21,7 @@ export default function FilterImageComponent(props: {
startDateString?: string;
endDateString?: string;
monthYearFilter?: any;
+ isRegionalCall?: any;
}) {
const {
categoryFilter,
@@ -28,6 +29,7 @@ export default function FilterImageComponent(props: {
startDateString,
endDateString,
monthYearFilter,
+ isRegionalCall,
} = props;
const router = useRouter();
const [newContent, setNewContent] = useState();
@@ -43,7 +45,7 @@ export default function FilterImageComponent(props: {
const [totalContent, setTotalContent] = useState();
const poldaName = params?.polda_name;
const satkerName = params?.satker_name;
- const isRegional = group || asPath.includes("/polda/");
+ const isRegional = isRegionalCall || group || asPath.includes("/polda/");
const searchType = isRegional ? "regional" : "filter";
useEffect(() => {
diff --git a/components/landing-page/filter-all/video-filter-card.tsx b/components/landing-page/filter-all/video-filter-card.tsx
index abe8b5f1..5e5d415a 100644
--- a/components/landing-page/filter-all/video-filter-card.tsx
+++ b/components/landing-page/filter-all/video-filter-card.tsx
@@ -23,6 +23,7 @@ export default function FilterVideoComponent(props: {
startDateString?: string;
endDateString?: string;
monthYearFilter?: any;
+ isRegionalCall?: any;
}) {
const {
categoryFilter,
@@ -30,6 +31,7 @@ export default function FilterVideoComponent(props: {
startDateString,
endDateString,
monthYearFilter,
+ isRegionalCall,
} = props;
const [newContent, setNewContent] = useState();
const asPath = usePathname();
@@ -43,8 +45,7 @@ export default function FilterVideoComponent(props: {
const categorie = searchParams?.get("category");
const group = searchParams?.get("group");
const [totalContent, setTotalContent] = useState();
-
- const isRegional = group || asPath.includes("/polda/");
+ const isRegional = isRegionalCall || group || asPath.includes("/polda/");
const searchType = isRegional ? "regional" : "filter";
const router = useRouter();
const poldaName = params?.polda_name;
From 73c56e764d6d038949c033cd70bc774cd367c748 Mon Sep 17 00:00:00 2001
From: Sabda Yagra
Date: Fri, 19 Sep 2025 00:01:44 +0700
Subject: [PATCH 04/10] fix: translate button in approver-int
---
components/form/content/audio-form.tsx | 119 +++++++++++++++++++-
components/form/content/image-form.tsx | 146 +++++++++++++++++++++----
components/form/content/teks-form.tsx | 121 +++++++++++++++++++-
components/form/content/video-form.tsx | 117 +++++++++++++++++++-
service/content/content.ts | 2 +-
5 files changed, 469 insertions(+), 36 deletions(-)
diff --git a/components/form/content/audio-form.tsx b/components/form/content/audio-form.tsx
index dee3eca7..caa36435 100644
--- a/components/form/content/audio-form.tsx
+++ b/components/form/content/audio-form.tsx
@@ -44,13 +44,14 @@ import {
getDetailArticle,
getGenerateKeywords,
getGenerateTitle,
+ translateText,
} from "@/service/content/ai";
import { getCookiesDecrypt } from "@/lib/utils";
import { useDropzone } from "react-dropzone";
import { Icon } from "@iconify/react";
import { CloudUpload } from "lucide-react";
import Image from "next/image";
-import { error, loading } from "@/config/swal";
+import { close, error, loading } from "@/config/swal";
import { Item } from "@radix-ui/react-dropdown-menu";
import dynamic from "next/dynamic";
import { getCsrfToken } from "@/service/auth";
@@ -145,6 +146,10 @@ export default function FormAudio() {
const [fileError, setFileError] = useState(null);
type FileWithPreview = File & { preview: string };
+ const [isLoadingTranslate, setIsLoadingTranslate] = useState(false);
+ const [translatedContent, setTranslatedContent] = React.useState("");
+ const [selectedLang, setSelectedLang] = React.useState<"id" | "en">("id");
+
const options: Option[] = [
{ id: "all", label: "SEMUA" },
{ id: "5", label: "UMUM" },
@@ -417,7 +422,8 @@ export default function FormAudio() {
""
);
const articleImagesData = articleData?.imagesUrl?.split(",");
- setArticleBody(cleanArticleBody || "");
+ setValue("description", cleanArticleBody || "");
+ // setArticleBody(cleanArticleBody || "");
setDetailData(articleData);
setSelectedArticleId(id);
setArticleImages(articleImagesData || []);
@@ -808,7 +814,8 @@ export default function FormAudio() {
lang: "id",
contextType: "text",
urlContext: null,
- context: editorContent,
+ context: getValues("descriptionOri"),
+ // context: editorContent,
createdBy: roleId,
sentiment: "Humorous",
clientId: "7QTW8cMojyayt6qnhqTOeJaBI70W4EaQ",
@@ -1178,7 +1185,111 @@ export default function FormAudio() {
Select Original Description
+
+
+
+
+ {roleId === "14" && (
+
+ )}
+
+
+ {/* Pilihan bahasa untuk posting */}
+ {roleId === "14" && (
+
+
+
+ )}
+
+ {/* Editor Bahasa Indonesia */}
+
(
+
+ )}
+ />
+
+ {/* Editor Bahasa Inggris */}
+ {translatedContent && (
+
+
+ {" "}
+
+
+
+
setTranslatedContent(val)}
+ initialData={translatedContent}
+ />
+
+ )}
+
+ {errors.description?.message && (
+
+ {errors.description.message}
+
+ )}
+
+
+ {/*
@@ -1200,7 +1311,7 @@ export default function FormAudio() {
{errors.description.message}
)}
-
+ */}
Content Rewrite
diff --git a/components/form/content/image-form.tsx b/components/form/content/image-form.tsx
index 43f9ad8a..57450183 100644
--- a/components/form/content/image-form.tsx
+++ b/components/form/content/image-form.tsx
@@ -51,7 +51,7 @@ import { useDropzone } from "react-dropzone";
import { Icon } from "@iconify/react";
import { CloudUpload, X } from "lucide-react";
import Image from "next/image";
-import { error, loading } from "@/config/swal";
+import { close, error, loading } from "@/config/swal";
import { Item } from "@radix-ui/react-dropdown-menu";
import { data } from "jquery";
import { options } from "@fullcalendar/core/preact.js";
@@ -149,6 +149,8 @@ export default function FormImage() {
const [files, setFiles] = useState([]);
const [filesTemp, setFilesTemp] = useState([]);
const [publishedFor, setPublishedFor] = useState([]);
+ const [translatedContent, setTranslatedContent] = React.useState("");
+ const [selectedLang, setSelectedLang] = React.useState<"id" | "en">("id");
const options: Option[] = [
{ id: "all", label: "SEMUA" },
@@ -449,7 +451,7 @@ export default function FormImage() {
""
);
const articleImagesData = articleData?.imagesUrl?.split(",");
- setArticleBody(cleanArticleBody || "");
+ setValue("description", cleanArticleBody || "");
setDetailData(articleData);
setSelectedArticleId(id);
setArticleImages(articleImagesData || []);
@@ -668,7 +670,6 @@ export default function FormImage() {
const resCsrf = await getCsrfToken();
const csrfToken = resCsrf?.data?.token;
- console.log("CSRF TOKEN : ", csrfToken);
const headers = {
"X-XSRF-TOKEN": csrfToken,
};
@@ -827,7 +828,7 @@ export default function FormImage() {
lang: "id",
contextType: "text",
urlContext: null,
- context: editorContent,
+ context: getValues("descriptionOri"),
createdBy: roleId,
sentiment: "Humorous",
clientId: "7QTW8cMojyayt6qnhqTOeJaBI70W4EaQ",
@@ -1198,9 +1199,9 @@ export default function FormImage() {
className="dark:text-black"
onChange={(value: any) => {
onChange(value);
- setEditorContent(value);
+ // setEditorContent(value);
}}
- initialData={articleBody || value}
+ initialData={value}
/>
)
}
@@ -1239,24 +1240,130 @@ export default function FormImage() {
type="button"
onClick={async () => {
try {
+ loading();
setIsLoadingTranslate(true);
const res = await translateText({
- text: localContent,
+ text: getValues("descriptionOri"),
sourceLang: "ID",
targetLang: "EN",
});
- if (!res.error && res.data?.translatedText) {
- setLocalContent(res.data.translatedText);
- setValue(
- "descriptionOri",
- res.data.translatedText
- );
- setEditorContent(res.data.translatedText);
+ if (!res.error) {
+ const resultText =
+ res?.data?.data?.translations?.[0]?.text ||
+ "";
+
+ setTranslatedContent(resultText);
}
} catch (err) {
+ close();
console.error("Translate gagal:", err);
} finally {
+ close();
+ setIsLoadingTranslate(false);
+ }
+ }}
+ className="px-3 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600"
+ >
+ {isLoadingTranslate
+ ? "Translating..."
+ : "Translate to English"}
+
+ )}
+
+
+ {/* Pilihan bahasa untuk posting */}
+ {roleId === "14" && (
+
+
+
+ )}
+
+ {/* Editor Bahasa Indonesia */}
+ (
+
+ )}
+ />
+
+ {/* Editor Bahasa Inggris */}
+ {translatedContent && (
+
+
+ {" "}
+
+
+
+
setTranslatedContent(val)}
+ initialData={translatedContent}
+ />
+
+ )}
+
+ {errors.description?.message && (
+
+ {errors.description.message}
+
+ )}
+
+ {/*
+
+
+
+ {roleId === "14" && (
+
- {/* Editor */}
{
onChange(val);
- setLocalContent(val);
- setEditorContent(val);
+ // setLocalContent(val);
+ // setEditorContent(val);
}}
- initialData={localContent || value}
+ initialData={value}
/>
)}
/>
@@ -1290,7 +1396,7 @@ export default function FormImage() {
{errors.description.message}
)}
-
+ */}
{/*
*/}
-
Content Rewrite
-
{showRewriteEditor && (
{isGeneratedArticle && (
diff --git a/components/form/content/teks-form.tsx b/components/form/content/teks-form.tsx
index ad9cb606..70b80275 100644
--- a/components/form/content/teks-form.tsx
+++ b/components/form/content/teks-form.tsx
@@ -44,13 +44,14 @@ import {
getDetailArticle,
getGenerateKeywords,
getGenerateTitle,
+ translateText,
} from "@/service/content/ai";
import { getCookiesDecrypt } from "@/lib/utils";
import { useDropzone } from "react-dropzone";
import { Icon } from "@iconify/react";
import { CloudUpload } from "lucide-react";
import Image from "next/image";
-import { error, loading } from "@/config/swal";
+import { close, error, loading } from "@/config/swal";
import { Item } from "@radix-ui/react-dropdown-menu";
import dynamic from "next/dynamic";
import { getCsrfToken } from "@/service/auth";
@@ -142,6 +143,11 @@ export default function FormTeks() {
const [files, setFiles] = useState([]);
const [publishedFor, setPublishedFor] = useState([]);
+
+ const [isLoadingTranslate, setIsLoadingTranslate] = useState(false);
+ const [translatedContent, setTranslatedContent] = React.useState("");
+ const [selectedLang, setSelectedLang] = React.useState<"id" | "en">("id");
+
const options: Option[] = [
{ id: "all", label: "SEMUA" },
{ id: "5", label: "UMUM" },
@@ -429,7 +435,8 @@ export default function FormTeks() {
""
);
const articleImagesData = articleData?.imagesUrl?.split(",");
- setArticleBody(cleanArticleBody || "");
+ setValue("description", cleanArticleBody || "");
+ // setArticleBody(cleanArticleBody || "");
setDetailData(articleData);
setSelectedArticleId(id);
setArticleImages(articleImagesData || []);
@@ -819,7 +826,8 @@ export default function FormTeks() {
lang: "id",
contextType: "text",
urlContext: null,
- context: editorContent,
+ context: getValues("descriptionOri"),
+ // context: editorContent,
createdBy: roleId,
sentiment: "Humorous",
clientId: "7QTW8cMojyayt6qnhqTOeJaBI70W4EaQ",
@@ -1185,7 +1193,110 @@ export default function FormTeks() {
Select Original Description
+
+
+
+
+ {roleId === "14" && (
+
+ )}
+
+
+ {/* Pilihan bahasa untuk posting */}
+ {roleId === "14" && (
+
+
+
+ )}
+
+ {/* Editor Bahasa Indonesia */}
+
(
+
+ )}
+ />
+
+ {/* Editor Bahasa Inggris */}
+ {translatedContent && (
+
+
+ {" "}
+
+
+
+
setTranslatedContent(val)}
+ initialData={translatedContent}
+ />
+
+ )}
+
+ {errors.description?.message && (
+
+ {errors.description.message}
+
+ )}
+
+ {/*
@@ -1207,7 +1318,7 @@ export default function FormTeks() {
{errors.description.message}
)}
-
+ */}
Content Rewrite
@@ -1329,8 +1440,6 @@ export default function FormTeks() {
/>
-
- {/* Submit Button */}
diff --git a/components/form/content/video-form.tsx b/components/form/content/video-form.tsx
index 040e2ec1..b0a30bb6 100644
--- a/components/form/content/video-form.tsx
+++ b/components/form/content/video-form.tsx
@@ -44,13 +44,14 @@ import {
getDetailArticle,
getGenerateKeywords,
getGenerateTitle,
+ translateText,
} from "@/service/content/ai";
import { getCookiesDecrypt } from "@/lib/utils";
import { useDropzone } from "react-dropzone";
import { Icon } from "@iconify/react";
import { CloudUpload } from "lucide-react";
import Image from "next/image";
-import { error, loading } from "@/config/swal";
+import { close, error, loading } from "@/config/swal";
import { Item } from "@radix-ui/react-dropdown-menu";
import dynamic from "next/dynamic";
import { getCsrfToken } from "@/service/auth";
@@ -146,6 +147,10 @@ export default function FormVideo() {
const [publishedFor, setPublishedFor] = useState([]);
const [files, setFiles] = useState([]);
+ const [isLoadingTranslate, setIsLoadingTranslate] = useState(false);
+ const [translatedContent, setTranslatedContent] = React.useState("");
+ const [selectedLang, setSelectedLang] = React.useState<"id" | "en">("id");
+
const options: Option[] = [
{ id: "all", label: "SEMUA" },
{ id: "5", label: "UMUM" },
@@ -423,7 +428,8 @@ export default function FormVideo() {
""
);
const articleImagesData = articleData?.imagesUrl?.split(",");
- setArticleBody(cleanArticleBody || "");
+ setValue("description", cleanArticleBody || "");
+ // setArticleBody(cleanArticleBody || "");
setDetailData(articleData);
setSelectedArticleId(id);
setArticleImages(articleImagesData || []);
@@ -827,7 +833,8 @@ export default function FormVideo() {
lang: "id",
contextType: "text",
urlContext: null,
- context: editorContent, // Ambil isi editor original
+ context: getValues("descriptionOri"),
+ // context: editorContent,
createdBy: roleId,
sentiment: "Humorous",
clientId: "7QTW8cMojyayt6qnhqTOeJaBI70W4EaQ",
@@ -1193,7 +1200,109 @@ export default function FormVideo() {
Select Original Description
+
+
+
+
+ {roleId === "14" && (
+
+ )}
+
+
+ {/* Pilihan bahasa untuk posting */}
+
+
+
+
+ {/* Editor Bahasa Indonesia */}
+
(
+
+ )}
+ />
+
+ {/* Editor Bahasa Inggris */}
+ {translatedContent && (
+
+
+ {" "}
+
+
+
+
setTranslatedContent(val)}
+ initialData={translatedContent}
+ />
+
+ )}
+
+ {errors.description?.message && (
+
+ {errors.description.message}
+
+ )}
+
+
+ {/*
@@ -1215,7 +1324,7 @@ export default function FormVideo() {
{errors.description.message}
)}
-
+ */}
Content Rewrite
diff --git a/service/content/content.ts b/service/content/content.ts
index 14fddef0..7aad0296 100644
--- a/service/content/content.ts
+++ b/service/content/content.ts
@@ -157,7 +157,7 @@ export async function getTagsBySubCategoryId(subCategory: any) {
}
export async function listEnableCategory(type: any) {
- const url = `media/categories/list?enablePage=0&sort=desc&sortBy=id&type=${type}`;
+ const url = `media/categories/list?enablePage=0&sort=desc&sortBy=id&type=${type}&isInt=true`;
return httpGetInterceptor(url);
}
From b72e145227d0d4e4c192ac6d47ea5012a7bc9dcb Mon Sep 17 00:00:00 2001
From: hanif salafi
Date: Fri, 19 Sep 2025 02:50:49 +0700
Subject: [PATCH 05/10] feat: update fixing error regional filter
---
.../(public)/regional/filter/page.tsx | 1 -
.../filter-all/audio-filter-card.tsx | 12 ++++--
.../filter-all/document-filter-card.tsx | 13 +++++--
.../filter-all/image-filter-card.tsx | 37 ++++++++++++-------
.../filter-all/indeks-filter-card.tsx | 18 +++++----
.../filter-all/video-filter-card.tsx | 37 ++++++++++++-------
6 files changed, 75 insertions(+), 43 deletions(-)
diff --git a/app/[locale]/(public)/regional/filter/page.tsx b/app/[locale]/(public)/regional/filter/page.tsx
index 9bd664da..5256c00b 100644
--- a/app/[locale]/(public)/regional/filter/page.tsx
+++ b/app/[locale]/(public)/regional/filter/page.tsx
@@ -745,7 +745,6 @@ export default function FilterPage() {
startDateString={startDateString}
endDateString={endDateString}
monthYearFilter={monthYearFilter}
- isRegionalCall={true}
/>
diff --git a/components/landing-page/filter-all/audio-filter-card.tsx b/components/landing-page/filter-all/audio-filter-card.tsx
index b1140454..10711b42 100644
--- a/components/landing-page/filter-all/audio-filter-card.tsx
+++ b/components/landing-page/filter-all/audio-filter-card.tsx
@@ -77,11 +77,16 @@ export default function FilterAudioComponent(props: {
let startDateFilter = startDateString ? startDateString : "";
let endDateFilter = endDateString ? endDateString : "";
let monthFilter = monthYearFilter ? monthYearFilter : "";
+ const search = title == undefined ? "" : title;
+ const filter =
+ categoryFilter?.length > 0
+ ? categoryFilter?.sort().join(",")
+ : categorie || "";
const response = await listDataRegional(
"4",
- "",
- "",
+ search,
+ filter,
"",
"",
startDateFilter,
@@ -95,7 +100,8 @@ export default function FilterAudioComponent(props: {
const contentData = data?.content;
setNewContent(contentData);
setTotalData(data?.totalElements);
- // setLoading(false);
+ setTotalPage(data?.totalPages);
+ setTotalContent(data?.totalElements);
}
useEffect(() => {
diff --git a/components/landing-page/filter-all/document-filter-card.tsx b/components/landing-page/filter-all/document-filter-card.tsx
index 550a125f..82b74550 100644
--- a/components/landing-page/filter-all/document-filter-card.tsx
+++ b/components/landing-page/filter-all/document-filter-card.tsx
@@ -79,10 +79,16 @@ export default function FilterDocumentComponent(props: {
let endDateFilter = endDateString ? endDateString : "";
let monthFilter = monthYearFilter ? monthYearFilter : "";
+ const search = title == undefined ? "" : title;
+ const filter =
+ categoryFilter?.length > 0
+ ? categoryFilter?.sort().join(",")
+ : categorie || "";
+
const response = await listDataRegional(
"3",
- "",
- "",
+ search,
+ filter,
"",
"",
startDateFilter,
@@ -96,7 +102,8 @@ export default function FilterDocumentComponent(props: {
const contentData = data?.content;
setNewContent(contentData);
setTotalData(data?.totalElements);
- // setLoading(false);
+ setTotalPage(data?.totalPages);
+ setTotalContent(data?.totalElements);
}
async function getDataAll() {
diff --git a/components/landing-page/filter-all/image-filter-card.tsx b/components/landing-page/filter-all/image-filter-card.tsx
index adb9f7a2..248b06d8 100644
--- a/components/landing-page/filter-all/image-filter-card.tsx
+++ b/components/landing-page/filter-all/image-filter-card.tsx
@@ -117,10 +117,16 @@ export default function FilterImageComponent(props: {
let endDateFilter = endDateString ? endDateString : "";
let monthFilter = monthYearFilter ? monthYearFilter : "";
+ const search = title == undefined ? "" : title;
+ const filter =
+ categoryFilter?.length > 0
+ ? categoryFilter?.sort().join(",")
+ : categorie || "";
+
const response = await listDataRegional(
"1",
- "",
- "",
+ search,
+ filter,
"",
"",
startDateFilter,
@@ -134,7 +140,8 @@ export default function FilterImageComponent(props: {
const contentData = data?.content;
setNewContent(contentData);
setTotalData(data?.totalElements);
- // setLoading(false);
+ setTotalPage(data?.totalPages);
+ setTotalContent(data?.totalElements);
}
const basePath = asPath.includes("/polda/")
@@ -205,17 +212,19 @@ export default function FilterImageComponent(props: {
// whileHover={{ scale: 0.95 }}
// transition={{ duration: 0.3 }}
>
-
+ {image?.thumbnailLink &&
+
+ }
{/* Badge category */}
diff --git a/components/landing-page/filter-all/indeks-filter-card.tsx b/components/landing-page/filter-all/indeks-filter-card.tsx
index 76592bf9..c32f159d 100644
--- a/components/landing-page/filter-all/indeks-filter-card.tsx
+++ b/components/landing-page/filter-all/indeks-filter-card.tsx
@@ -171,14 +171,16 @@ export default function IndeksCarouselComponent(props: {
className="cursor-pointer relative group overflow-hidden bg-white dark:bg-black dark:border dark:border-gray-500 rounded-xl shadow-md hover:shadow-lg transition-shadow duration-300"
>
-
+ {image?.thumbnailLink &&
+
+ }
diff --git a/components/landing-page/filter-all/video-filter-card.tsx b/components/landing-page/filter-all/video-filter-card.tsx
index 5e5d415a..100ff296 100644
--- a/components/landing-page/filter-all/video-filter-card.tsx
+++ b/components/landing-page/filter-all/video-filter-card.tsx
@@ -79,10 +79,16 @@ export default function FilterVideoComponent(props: {
let endDateFilter = endDateString ? endDateString : "";
let monthFilter = monthYearFilter ? monthYearFilter : "";
+ const search = title == undefined ? "" : title;
+ const filter =
+ categoryFilter?.length > 0
+ ? categoryFilter?.sort().join(",")
+ : categorie || "";
+
const response = await listDataRegional(
"2",
- "",
- "",
+ search,
+ filter,
"",
"",
startDateFilter,
@@ -96,7 +102,8 @@ export default function FilterVideoComponent(props: {
const contentData = data?.content;
setNewContent(contentData);
setTotalData(data?.totalElements);
- // setLoading(false);
+ setTotalPage(data?.totalPages);
+ setTotalContent(data?.totalElements);
}
async function getDataAll() {
@@ -165,17 +172,19 @@ export default function FilterVideoComponent(props: {
// whileHover={{ scale: 0.95 }}
// transition={{ duration: 0.3 }}
>
-
+ {video?.thumbnailLink &&
+
+ }
{/* Badge category */}
From 9cf5498c88a092469431fa507fa9ebce2b4a1f2c Mon Sep 17 00:00:00 2001
From: Sabda Yagra
Date: Fri, 19 Sep 2025 09:52:32 +0700
Subject: [PATCH 06/10] fix: link hred in image-filter-card
---
.../filter-all/audio-filter-card.tsx | 13 +++++++------
.../filter-all/document-filter-card.tsx | 15 ++++++++-------
.../filter-all/image-filter-card.tsx | 18 ++++++++++++------
.../filter-all/indeks-filter-card.tsx | 8 ++++----
.../filter-all/video-filter-card.tsx | 17 +++++++++--------
5 files changed, 40 insertions(+), 31 deletions(-)
diff --git a/components/landing-page/filter-all/audio-filter-card.tsx b/components/landing-page/filter-all/audio-filter-card.tsx
index 10711b42..2737b197 100644
--- a/components/landing-page/filter-all/audio-filter-card.tsx
+++ b/components/landing-page/filter-all/audio-filter-card.tsx
@@ -54,7 +54,7 @@ export default function FilterAudioComponent(props: {
? `/polda/${poldaName}`
: satkerName
? `/satker/${satkerName}`
- : "/";
+ : "";
useEffect(() => {
if (searchType === "regional") {
@@ -242,10 +242,11 @@ export default function FilterAudioComponent(props: {
{newContent?.map((audio: any) => (
-
- router.push(prefixPath + `/audio/detail/${audio?.slug}`)
- }
+
+ // router.push(prefixPath + `/audio/detail/${audio?.slug}`)
+ // }
className="cursor-pointer bg-white dark:bg-black dark:border dark:border-gray-500 rounded-xl shadow-md hover:shadow-lg transition-shadow duration-300 overflow-hidden"
>
{/* Icon Background */}
@@ -273,7 +274,7 @@ export default function FilterAudioComponent(props: {
{audio?.title}
-
+
))}
diff --git a/components/landing-page/filter-all/document-filter-card.tsx b/components/landing-page/filter-all/document-filter-card.tsx
index 82b74550..f15c8c5a 100644
--- a/components/landing-page/filter-all/document-filter-card.tsx
+++ b/components/landing-page/filter-all/document-filter-card.tsx
@@ -55,7 +55,7 @@ export default function FilterDocumentComponent(props: {
? `/polda/${poldaName}`
: satkerName
? `/satker/${satkerName}`
- : "/";
+ : "";
useEffect(() => {
if (searchType === "regional") {
@@ -84,7 +84,7 @@ export default function FilterDocumentComponent(props: {
categoryFilter?.length > 0
? categoryFilter?.sort().join(",")
: categorie || "";
-
+
const response = await listDataRegional(
"3",
search,
@@ -213,10 +213,11 @@ export default function FilterDocumentComponent(props: {
{newContent?.map((text: any) => (
-
- router.push(prefixPath + `/document/detail/${text?.slug}`)
- }
+
+ // router.push(prefixPath + `/document/detail/${text?.slug}`)
+ // }
className="cursor-pointer rounded-lg shadow-md overflow-hidden bg-white dark:bg-black dark:border dark:border-gray-500"
>
{/* Ikon di tengah dengan latar kuning */}
@@ -246,7 +247,7 @@ export default function FilterDocumentComponent(props: {
{text?.title}
-
+
))}
diff --git a/components/landing-page/filter-all/image-filter-card.tsx b/components/landing-page/filter-all/image-filter-card.tsx
index 248b06d8..edc07601 100644
--- a/components/landing-page/filter-all/image-filter-card.tsx
+++ b/components/landing-page/filter-all/image-filter-card.tsx
@@ -157,11 +157,17 @@ export default function FilterImageComponent(props: {
}${endDateString ? `&endDate=${endDateString}` : ""}`;
const href = `${basePath}/image/${fullQuery}`;
+ // let prefixPath = poldaName
+ // ? `/polda/${poldaName}`
+ // : satkerName
+ // ? `/satker/${satkerName}`
+ // : "";
+
let prefixPath = poldaName
- ? `/polda/${poldaName}`
+ ? `/polda/${poldaName}/image/detail`
: satkerName
- ? `/satker/${satkerName}`
- : "/";
+ ? `/satker/${satkerName}/image/detail`
+ : `/image/detail`;
return newContent?.length > 0 ? (
@@ -200,7 +206,7 @@ export default function FilterImageComponent(props: {
{newContent?.map((image: any) => (
// router.push(prefixPath + `/image/detail/${image?.slug}`)
// }
@@ -212,7 +218,7 @@ export default function FilterImageComponent(props: {
// whileHover={{ scale: 0.95 }}
// transition={{ duration: 0.3 }}
>
- {image?.thumbnailLink &&
+ {image?.thumbnailLink && (
- }
+ )}
{/* Badge category */}
diff --git a/components/landing-page/filter-all/indeks-filter-card.tsx b/components/landing-page/filter-all/indeks-filter-card.tsx
index c32f159d..febcc9fe 100644
--- a/components/landing-page/filter-all/indeks-filter-card.tsx
+++ b/components/landing-page/filter-all/indeks-filter-card.tsx
@@ -50,7 +50,7 @@ export default function IndeksCarouselComponent(props: {
? `/polda/${poldaName}`
: satkerName
? `/satker/${satkerName}`
- : "/";
+ : "";
// useEffect(() => {
// initFetch();
@@ -166,8 +166,8 @@ export default function IndeksCarouselComponent(props: {
{newContent.map((image: any) => (
- router.push(`/indeks/detail/${image?.slug}`)}
+
router.push(`/indeks/detail/${image?.slug}`)}
className="cursor-pointer relative group overflow-hidden bg-white dark:bg-black dark:border dark:border-gray-500 rounded-xl shadow-md hover:shadow-lg transition-shadow duration-300"
>
@@ -193,7 +193,7 @@ export default function IndeksCarouselComponent(props: {
-
+
))}
diff --git a/components/landing-page/filter-all/video-filter-card.tsx b/components/landing-page/filter-all/video-filter-card.tsx
index 100ff296..0c748eb6 100644
--- a/components/landing-page/filter-all/video-filter-card.tsx
+++ b/components/landing-page/filter-all/video-filter-card.tsx
@@ -55,7 +55,7 @@ export default function FilterVideoComponent(props: {
? `/polda/${poldaName}`
: satkerName
? `/satker/${satkerName}`
- : "/";
+ : "";
useEffect(() => {
if (searchType === "regional") {
@@ -160,10 +160,11 @@ export default function FilterVideoComponent(props: {
{newContent?.map((video: any) => (
-
- router.push(prefixPath + `/video/detail/${video?.slug}`)
- }
+
+ // router.push(prefixPath + `/video/detail/${video?.slug}`)
+ // }
className="cursor-pointer relative group overflow-hidden bg-white dark:bg-black dark:border dark:border-gray-500 rounded-xl shadow-md hover:shadow-lg transition-shadow duration-300"
>
{/* Image with motion effect */}
@@ -172,7 +173,7 @@ export default function FilterVideoComponent(props: {
// whileHover={{ scale: 0.95 }}
// transition={{ duration: 0.3 }}
>
- {video?.thumbnailLink &&
+ {video?.thumbnailLink && (
- }
+ )}
{/* Badge category */}
@@ -226,7 +227,7 @@ export default function FilterVideoComponent(props: {
*/}
-
+
))}
From 683c4cc4657c95d31a88e51f35dc20ef4b589bb3 Mon Sep 17 00:00:00 2001
From: Sabda Yagra
Date: Fri, 19 Sep 2025 13:57:06 +0700
Subject: [PATCH 07/10] fix: href link in card filter
---
.../landing-page/filter-all/audio-filter-card.tsx | 3 ++-
.../filter-all/document-filter-card.tsx | 3 ++-
.../landing-page/filter-all/image-filter-card.tsx | 14 ++++----------
.../landing-page/filter-all/video-filter-card.tsx | 3 ++-
4 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/components/landing-page/filter-all/audio-filter-card.tsx b/components/landing-page/filter-all/audio-filter-card.tsx
index 2737b197..87cc1567 100644
--- a/components/landing-page/filter-all/audio-filter-card.tsx
+++ b/components/landing-page/filter-all/audio-filter-card.tsx
@@ -243,7 +243,8 @@ export default function FilterAudioComponent(props: {
{newContent?.map((audio: any) => (
// router.push(prefixPath + `/audio/detail/${audio?.slug}`)
// }
diff --git a/components/landing-page/filter-all/document-filter-card.tsx b/components/landing-page/filter-all/document-filter-card.tsx
index f15c8c5a..14315f49 100644
--- a/components/landing-page/filter-all/document-filter-card.tsx
+++ b/components/landing-page/filter-all/document-filter-card.tsx
@@ -214,7 +214,8 @@ export default function FilterDocumentComponent(props: {
{newContent?.map((text: any) => (
// router.push(prefixPath + `/document/detail/${text?.slug}`)
// }
diff --git a/components/landing-page/filter-all/image-filter-card.tsx b/components/landing-page/filter-all/image-filter-card.tsx
index edc07601..111b6d74 100644
--- a/components/landing-page/filter-all/image-filter-card.tsx
+++ b/components/landing-page/filter-all/image-filter-card.tsx
@@ -157,17 +157,11 @@ export default function FilterImageComponent(props: {
}${endDateString ? `&endDate=${endDateString}` : ""}`;
const href = `${basePath}/image/${fullQuery}`;
- // let prefixPath = poldaName
- // ? `/polda/${poldaName}`
- // : satkerName
- // ? `/satker/${satkerName}`
- // : "";
-
let prefixPath = poldaName
- ? `/polda/${poldaName}/image/detail`
+ ? `/polda/${poldaName}`
: satkerName
- ? `/satker/${satkerName}/image/detail`
- : `/image/detail`;
+ ? `/satker/${satkerName}`
+ : "";
return newContent?.length > 0 ? (
@@ -206,7 +200,7 @@ export default function FilterImageComponent(props: {
{newContent?.map((image: any) => (
// router.push(prefixPath + `/image/detail/${image?.slug}`)
// }
diff --git a/components/landing-page/filter-all/video-filter-card.tsx b/components/landing-page/filter-all/video-filter-card.tsx
index 0c748eb6..3f669f72 100644
--- a/components/landing-page/filter-all/video-filter-card.tsx
+++ b/components/landing-page/filter-all/video-filter-card.tsx
@@ -161,7 +161,8 @@ export default function FilterVideoComponent(props: {
{newContent?.map((video: any) => (
// router.push(prefixPath + `/video/detail/${video?.slug}`)
// }
From b7e425877358e2831d45da0562c717375194352e Mon Sep 17 00:00:00 2001
From: Sabda Yagra
Date: Fri, 19 Sep 2025 14:32:29 +0700
Subject: [PATCH 08/10] fix: href link in filter card
---
components/landing-page/filter-all/audio-filter-card.tsx | 2 +-
components/landing-page/filter-all/document-filter-card.tsx | 2 +-
components/landing-page/filter-all/image-filter-card.tsx | 2 +-
components/landing-page/filter-all/video-filter-card.tsx | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/components/landing-page/filter-all/audio-filter-card.tsx b/components/landing-page/filter-all/audio-filter-card.tsx
index 87cc1567..1469a140 100644
--- a/components/landing-page/filter-all/audio-filter-card.tsx
+++ b/components/landing-page/filter-all/audio-filter-card.tsx
@@ -243,7 +243,7 @@ export default function FilterAudioComponent(props: {
{newContent?.map((audio: any) => (
// router.push(prefixPath + `/audio/detail/${audio?.slug}`)
diff --git a/components/landing-page/filter-all/document-filter-card.tsx b/components/landing-page/filter-all/document-filter-card.tsx
index 14315f49..7970851f 100644
--- a/components/landing-page/filter-all/document-filter-card.tsx
+++ b/components/landing-page/filter-all/document-filter-card.tsx
@@ -214,7 +214,7 @@ export default function FilterDocumentComponent(props: {
{newContent?.map((text: any) => (
// router.push(prefixPath + `/document/detail/${text?.slug}`)
diff --git a/components/landing-page/filter-all/image-filter-card.tsx b/components/landing-page/filter-all/image-filter-card.tsx
index 111b6d74..de5e1c15 100644
--- a/components/landing-page/filter-all/image-filter-card.tsx
+++ b/components/landing-page/filter-all/image-filter-card.tsx
@@ -200,7 +200,7 @@ export default function FilterImageComponent(props: {
{newContent?.map((image: any) => (
// router.push(prefixPath + `/image/detail/${image?.slug}`)
// }
diff --git a/components/landing-page/filter-all/video-filter-card.tsx b/components/landing-page/filter-all/video-filter-card.tsx
index 3f669f72..81e336e0 100644
--- a/components/landing-page/filter-all/video-filter-card.tsx
+++ b/components/landing-page/filter-all/video-filter-card.tsx
@@ -161,7 +161,7 @@ export default function FilterVideoComponent(props: {
{newContent?.map((video: any) => (
// router.push(prefixPath + `/video/detail/${video?.slug}`)
From 49a257cab4e276fcd76a75212ab0d25db4433f71 Mon Sep 17 00:00:00 2001
From: Sabda Yagra
Date: Fri, 19 Sep 2025 18:15:00 +0700
Subject: [PATCH 09/10] fix:href link in card filter
---
components/landing-page/filter-all/audio-filter-card.tsx | 2 +-
components/landing-page/filter-all/document-filter-card.tsx | 2 +-
components/landing-page/filter-all/image-filter-card.tsx | 2 +-
components/landing-page/filter-all/video-filter-card.tsx | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/components/landing-page/filter-all/audio-filter-card.tsx b/components/landing-page/filter-all/audio-filter-card.tsx
index 1469a140..5a641788 100644
--- a/components/landing-page/filter-all/audio-filter-card.tsx
+++ b/components/landing-page/filter-all/audio-filter-card.tsx
@@ -243,7 +243,7 @@ export default function FilterAudioComponent(props: {
{newContent?.map((audio: any) => (
// router.push(prefixPath + `/audio/detail/${audio?.slug}`)
diff --git a/components/landing-page/filter-all/document-filter-card.tsx b/components/landing-page/filter-all/document-filter-card.tsx
index 7970851f..aa8bc82d 100644
--- a/components/landing-page/filter-all/document-filter-card.tsx
+++ b/components/landing-page/filter-all/document-filter-card.tsx
@@ -214,7 +214,7 @@ export default function FilterDocumentComponent(props: {
{newContent?.map((text: any) => (
// router.push(prefixPath + `/document/detail/${text?.slug}`)
diff --git a/components/landing-page/filter-all/image-filter-card.tsx b/components/landing-page/filter-all/image-filter-card.tsx
index de5e1c15..d68c47f4 100644
--- a/components/landing-page/filter-all/image-filter-card.tsx
+++ b/components/landing-page/filter-all/image-filter-card.tsx
@@ -200,7 +200,7 @@ export default function FilterImageComponent(props: {
{newContent?.map((image: any) => (
// router.push(prefixPath + `/image/detail/${image?.slug}`)
// }
diff --git a/components/landing-page/filter-all/video-filter-card.tsx b/components/landing-page/filter-all/video-filter-card.tsx
index 81e336e0..d689f66e 100644
--- a/components/landing-page/filter-all/video-filter-card.tsx
+++ b/components/landing-page/filter-all/video-filter-card.tsx
@@ -161,7 +161,7 @@ export default function FilterVideoComponent(props: {
{newContent?.map((video: any) => (
// router.push(prefixPath + `/video/detail/${video?.slug}`)
From 20f7b194714af1a01577005fdc5a7169e1859a47 Mon Sep 17 00:00:00 2001
From: Sabda Yagra
Date: Tue, 23 Sep 2025 17:42:27 +0700
Subject: [PATCH 10/10] fix: edit notification success in media-tracking
---
.../tracking-berita/component/table.tsx | 55 +++++++++++++++++--
1 file changed, 51 insertions(+), 4 deletions(-)
diff --git a/app/[locale]/(protected)/admin/media-tracking/tracking-berita/component/table.tsx b/app/[locale]/(protected)/admin/media-tracking/tracking-berita/component/table.tsx
index 33d03582..e3d3a51e 100644
--- a/app/[locale]/(protected)/admin/media-tracking/tracking-berita/component/table.tsx
+++ b/app/[locale]/(protected)/admin/media-tracking/tracking-berita/component/table.tsx
@@ -22,6 +22,8 @@ import { PaginationState } from "@tanstack/react-table";
import page from "../page";
import CustomPagination from "@/components/table/custom-pagination";
import { close, loading } from "@/config/swal";
+import withReactContent from "sweetalert2-react-content";
+import Swal from "sweetalert2";
export default function TrackingBeritaCard() {
const [search, setSearch] = useState("");
@@ -30,6 +32,7 @@ export default function TrackingBeritaCard() {
const [page, setPage] = useState(1);
const [totalPage, setTotalPage] = useState(1);
const [showData, setShowData] = useState("6");
+ const MySwal = withReactContent(Swal);
useEffect(() => {
initFecth();
@@ -70,13 +73,45 @@ export default function TrackingBeritaCard() {
);
};
+ // const doSave = async () => {
+ // if (selectedItems.length === 0) {
+ // toast("Pilih minimal 1 berita untuk disimpan.");
+ // return;
+ // }
+
+ // try {
+ // const promises = selectedItems.map((id) =>
+ // mediaTrackingSave({
+ // mediaUploadId: id,
+ // duration: 24,
+ // scrapingPeriod: 3,
+ // })
+ // );
+ // await Promise.all(promises);
+
+ // toast("Berhasil Menambahkan", {
+ // description: "",
+ // });
+ // setSelectedItems([]);
+ // initFecth();
+ // } catch (err: any) {
+ // error(err?.message || "Gagal menyimpan data.");
+ // }
+ // };
+
const doSave = async () => {
if (selectedItems.length === 0) {
- toast("Pilih minimal 1 berita untuk disimpan.");
+ MySwal.fire(
+ "Peringatan",
+ "Pilih minimal 1 berita untuk disimpan.",
+ "warning"
+ );
return;
}
try {
+ loading();
+
const promises = selectedItems.map((id) =>
mediaTrackingSave({
mediaUploadId: id,
@@ -86,13 +121,25 @@ export default function TrackingBeritaCard() {
);
await Promise.all(promises);
- toast("Berhasil Menambahkan", {
- description: "",
+ close();
+
+ await MySwal.fire({
+ icon: "success",
+ title: "Berhasil!",
+ text: "Tracking berita berhasil ditambahkan.",
+ confirmButtonColor: "#2563eb",
});
+
setSelectedItems([]);
initFecth();
} catch (err: any) {
- error(err?.message || "Gagal menyimpan data.");
+ close();
+ MySwal.fire({
+ icon: "error",
+ title: "Gagal!",
+ text: err?.message || "Terjadi kesalahan saat menyimpan data.",
+ confirmButtonColor: "#dc2626",
+ });
}
};