diff --git a/components/form/content/image-detail-form.tsx b/components/form/content/image-detail-form.tsx index 2ad40e5f..8a1f40fa 100644 --- a/components/form/content/image-detail-form.tsx +++ b/components/form/content/image-detail-form.tsx @@ -255,15 +255,15 @@ export default function FormImageDetail() { setSelectedPublishers(publisherIds); } - const matchingCategory = categories.find( - (category) => category.id === details.categoryId - ); + // const matchingCategory = categories.find( + // (category) => category.id === details.categoryId + // ); - if (matchingCategory) { - setSelectedTarget(matchingCategory.name); - } + // if (matchingCategory) { + // setSelectedTarget(matchingCategory.name); + // } - setSelectedTarget(details.categoryId); // Untuk dropdown + // setSelectedTarget(details.categoryId); const filesData = details.files || []; const fileUrls = filesData.map((file: { thumbnailFileUrl: string }) => @@ -488,19 +488,21 @@ export default function FormImageDetail() {
+ { console.log("Selected Category ID:", id); setSelectedCategory(id); diff --git a/components/form/content/image-update-form.tsx b/components/form/content/image-update-form.tsx index 1ab93172..aa9c129b 100644 --- a/components/form/content/image-update-form.tsx +++ b/components/form/content/image-update-form.tsx @@ -654,8 +654,6 @@ export default function FormImageUpdate() { error(response.message); return; } - - // Jika berhasil, hapus file dari state lokal setFiles((prevFiles: any) => prevFiles.filter((file: any) => file.id !== id) ); diff --git a/components/form/content/video-detail-form.tsx b/components/form/content/video-detail-form.tsx index 569304b6..04baa3d6 100644 --- a/components/form/content/video-detail-form.tsx +++ b/components/form/content/video-detail-form.tsx @@ -503,7 +503,7 @@ export default function FormVideoDetail() { className="object-fill h-full w-full" src={data.secondaryUrl} controls - title={`Video ${data.id}`} // Mengganti alt dengan title + title={`Video ${data.id}`} /> ))} diff --git a/components/landing-page/scrollable-content-polda.tsx b/components/landing-page/scrollable-content-polda.tsx index 117c16c6..38dc2240 100644 --- a/components/landing-page/scrollable-content-polda.tsx +++ b/components/landing-page/scrollable-content-polda.tsx @@ -1,15 +1,22 @@ import search from "@/app/[locale]/(protected)/app/chat/components/search"; import { useTranslations } from "next-intl"; -import { useParams, useRouter } from "next/navigation"; +import { useParams } from "next/navigation"; import router from "next/router"; import React, { useEffect, useState } from "react"; import { Icon } from "@iconify/react/dist/iconify.js"; -import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from "../ui/select"; +import { + Select, + SelectContent, + SelectGroup, + SelectItem, + SelectTrigger, + SelectValue, +} from "../ui/select"; import Image from "next/image"; import { getHeroData } from "@/service/landing/landing"; import { title } from "process"; import { htmlToString } from "@/utils/globals"; -import { Link } from "@/i18n/routing"; +import { Link, useRouter } from "@/i18n/routing"; const ScrollableContentPolda = () => { const [contentType, setContentType] = useState("all"); @@ -20,6 +27,14 @@ const ScrollableContentPolda = () => { const t = useTranslations("LandingPage"); const poldaName: any = params?.polda_name; const [content, setContent] = useState(); + const satkerName = params?.satker_name; + + let prefixPath = poldaName + ? `/polda/${poldaName}` + : satkerName + ? `/satker/${satkerName}` + : ""; + useEffect(() => { async function fetchCategories() { const url = "https://netidhub.com/api/csrf"; @@ -71,7 +86,14 @@ const ScrollableContentPolda = () => {
- + - setSearch(e.target.value)} /> + setSearch(e.target.value)} + />
- diff --git a/components/landing-page/scrollable-content-satker.tsx b/components/landing-page/scrollable-content-satker.tsx index eda8f006..0eadf8b2 100644 --- a/components/landing-page/scrollable-content-satker.tsx +++ b/components/landing-page/scrollable-content-satker.tsx @@ -1,6 +1,6 @@ import search from "@/app/[locale]/(protected)/app/chat/components/search"; import { useTranslations } from "next-intl"; -import { useParams, useRouter } from "next/navigation"; +import { useParams } from "next/navigation"; import router from "next/router"; import React, { useEffect, useState } from "react"; import { Icon } from "@iconify/react/dist/iconify.js"; @@ -16,7 +16,7 @@ import Image from "next/image"; import { getHeroData } from "@/service/landing/landing"; import { title } from "process"; import { htmlToString } from "@/utils/globals"; -import { Link } from "@/i18n/routing"; +import { Link, useRouter } from "@/i18n/routing"; const ScrollableContentSatker = () => { const [contentType, setContentType] = useState("all"); @@ -27,6 +27,13 @@ const ScrollableContentSatker = () => { const t = useTranslations("LandingPage"); const satkerName: any = params?.satker_name; const [content, setContent] = useState(); + const poldaName: any = params?.polda_name; + + let prefixPath = poldaName + ? `/polda/${poldaName}` + : satkerName + ? `/satker/${satkerName}` + : ""; useEffect(() => { async function fetchCategories() { const url = "https://netidhub.com/api/csrf"; @@ -128,7 +135,7 @@ const ScrollableContentSatker = () => {