From 146bd8d7820fb9c27df9112a182329da014893a7 Mon Sep 17 00:00:00 2001 From: Anang Yusman Date: Fri, 28 Feb 2025 18:54:42 +0800 Subject: [PATCH] feat:curated-content --- .../giat-routine/audio/audio.tsx | 103 +++++----- .../giat-routine/audio/detail/[id]/page.tsx | 23 +-- .../document/detail/[id]/page.tsx | 19 +- .../giat-routine/document/teks.tsx | 153 +++++++-------- .../giat-routine/image/all/page.tsx | 4 +- .../giat-routine/image/detail/[id]/page.tsx | 7 +- .../giat-routine/image/image.tsx | 176 ++++++++---------- .../giat-routine/video/audio-visual.tsx | 138 +++++++------- .../giat-routine/video/detail/[id]/page.tsx | 24 +-- .../shared/curated-content/page.tsx | 65 ------- 10 files changed, 311 insertions(+), 401 deletions(-) diff --git a/app/[locale]/(protected)/shared/curated-content/giat-routine/audio/audio.tsx b/app/[locale]/(protected)/shared/curated-content/giat-routine/audio/audio.tsx index 2cca7129..c56a5010 100644 --- a/app/[locale]/(protected)/shared/curated-content/giat-routine/audio/audio.tsx +++ b/app/[locale]/(protected)/shared/curated-content/giat-routine/audio/audio.tsx @@ -1,5 +1,6 @@ "use client"; import { Link } from "@/components/navigation"; +import { Card } from "@/components/ui/card"; import { Carousel, CarouselContent, @@ -30,14 +31,6 @@ const AudioSliderPage = () => { initFetch(); }, [page, limit, search]); - // useEffect(() => { - // if (audioData?.length > 0) { - // shuffleAndSetVideos(); - // const interval = setInterval(shuffleAndSetVideos, 5000); - // return () => clearInterval(interval); // Cleanup interval on unmount - // } - // }, [audioData]); - const initFetch = async () => { const response = await listCuratedContent(search, limit, page - 1, 4, "1"); console.log(response); @@ -48,11 +41,6 @@ const AudioSliderPage = () => { setDisplayAudio(contentData); }; - // const shuffleAndSetVideos = () => { - // const shuffled = shuffleArray([...audioData]); - // setDisplayAudio(shuffled.slice(0, 3)); - // }; - const shuffleArray = (array: any[]) => { for (let i = array.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); @@ -62,46 +50,61 @@ const AudioSliderPage = () => { }; return ( - - - {Array.from({ length: 5 }).map((_, index) => ( - -
- {displayAudio?.map((audio: any) => ( - -
- - - -
+
+ {displayAudio.length > 0 && ( +
+
+

Audio

+ + Lihat Semua + +
+ + + {displayAudio.map((audio, index) => ( + +
+ + +
+
+ + + +
-
-
- {audio?.title} -
+
+
+ {audio?.title} +
+
+
+ +
- + ))} -
-
- ))} -
- - -
+ + + + +
+ )} +
); }; diff --git a/app/[locale]/(protected)/shared/curated-content/giat-routine/audio/detail/[id]/page.tsx b/app/[locale]/(protected)/shared/curated-content/giat-routine/audio/detail/[id]/page.tsx index d7f4774e..be92bda4 100644 --- a/app/[locale]/(protected)/shared/curated-content/giat-routine/audio/detail/[id]/page.tsx +++ b/app/[locale]/(protected)/shared/curated-content/giat-routine/audio/detail/[id]/page.tsx @@ -574,35 +574,36 @@ export default function DetailAudio() { key={data.id} className="flex items-center gap-3 mt-2" > - {/* {`Thumbnail */}
{/* Mabes Checkbox */} - {/* Polda Checkbox */} - {/* International Checkbox */} + +
); }; diff --git a/app/[locale]/(protected)/shared/curated-content/giat-routine/video/detail/[id]/page.tsx b/app/[locale]/(protected)/shared/curated-content/giat-routine/video/detail/[id]/page.tsx index faec2dbe..871c2268 100644 --- a/app/[locale]/(protected)/shared/curated-content/giat-routine/video/detail/[id]/page.tsx +++ b/app/[locale]/(protected)/shared/curated-content/giat-routine/video/detail/[id]/page.tsx @@ -523,39 +523,39 @@ export default function DetailImage() { key={data.id} className="flex items-center gap-3 mt-2" > - {/* {`Thumbnail */} {`
- {/* Mabes Checkbox */} - {/* Polda Checkbox */} - {/* International Checkbox */} + +
-
- - -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-