diff --git a/app/[locale]/(public)/regional/filter/page.tsx b/app/[locale]/(public)/regional/filter/page.tsx index 06965b6b..5256c00b 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} /> (); 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; @@ -75,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, @@ -93,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 be4006f7..82b74550 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(); @@ -77,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, @@ -94,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 40743fd7..248b06d8 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(() => { @@ -115,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, @@ -132,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/") @@ -203,17 +212,19 @@ export default function FilterImageComponent(props: { // whileHover={{ scale: 0.95 }} // transition={{ duration: 0.3 }} > - image + {image?.thumbnailLink && + image + } {/* 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 + {image?.thumbnailLink && + image + }
diff --git a/components/landing-page/filter-all/video-filter-card.tsx b/components/landing-page/filter-all/video-filter-card.tsx index abe8b5f1..100ff296 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; @@ -78,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, @@ -95,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() { @@ -164,17 +172,19 @@ export default function FilterVideoComponent(props: { // whileHover={{ scale: 0.95 }} // transition={{ duration: 0.3 }} > - video + {video?.thumbnailLink && + video + }
{/* Badge category */}