From b4f6752c1aab69ab508883291b84fccf79ed064d Mon Sep 17 00:00:00 2001 From: sabdayagra Date: Thu, 19 Dec 2024 22:20:03 +0700 Subject: [PATCH] feat: add detail doc and audio components, add api to feedback --- .../(public)/audio/detail/[slug]/page.tsx | 144 ++++++++++++++ app/[locale]/(public)/audio/filter/page.tsx | 9 +- .../(public)/document/detail/[slug]/page.tsx | 143 ++++++++++++++ .../(public)/document/filter/page.tsx | 5 +- app/[locale]/(public)/feedback/page.tsx | 16 +- .../(public)/indeks/detail/[slug]/page.tsx | 56 +++--- app/[locale]/(public)/indeks/page.tsx | 4 +- app/[locale]/(public)/video/filter/page.tsx | 5 +- components/landing-page/new-content.tsx | 10 +- package-lock.json | 175 +++++++----------- package.json | 2 + public/assets/audio-btn.png | Bin 0 -> 1972 bytes service/landing/landing.ts | 8 + 13 files changed, 424 insertions(+), 153 deletions(-) create mode 100644 app/[locale]/(public)/audio/detail/[slug]/page.tsx create mode 100644 app/[locale]/(public)/document/detail/[slug]/page.tsx create mode 100644 public/assets/audio-btn.png diff --git a/app/[locale]/(public)/audio/detail/[slug]/page.tsx b/app/[locale]/(public)/audio/detail/[slug]/page.tsx new file mode 100644 index 00000000..8901aa89 --- /dev/null +++ b/app/[locale]/(public)/audio/detail/[slug]/page.tsx @@ -0,0 +1,144 @@ +"use client"; + +import { useParams, usePathname, useRouter } from "next/navigation"; +import React, { useEffect, useState } from "react"; +import { Icon } from "@iconify/react/dist/iconify.js"; +import { getDetail } from "@/service/landing/landing"; +import VideoPlayer from "@/utils/video-player"; +import NewContent from "@/components/landing-page/new-content"; +import { Link } from "@/i18n/routing"; +import { Textarea } from "@/components/ui/textarea"; +import { BarWave } from "react-cssfx-loading"; + +const DetailAudio = () => { + const [selectedSize, setSelectedSize] = useState("L"); + const [selectedTab, setSelectedTab] = useState("video"); + const router = useRouter(); + const pathname = usePathname(); + const params = useParams(); + const slug = params?.slug; + const [detailDataAudio, setDetailDataAudio] = useState(); + + useEffect(() => { + initFetch(); + }, []); + + const initFetch = async () => { + const response = await getDetail(String(slug)); + console.log("detailAudio", response); + setDetailDataAudio(response?.data?.data); + }; + + const sizes = [ + { label: "XL", value: "3198 x 1798 px" }, + { label: "L", value: "2399 x 1349 px" }, + { label: "M", value: "1599 x 899 px" }, + { label: "S", value: "1066 x 599 px" }, + { label: "XS", value: "800 x 450 px" }, + ]; + + return ( + <> +
+ {/* Container Utama */} +
+ {/* Bagian Kiri */} +
+
+ + +
+
+
+ + {/* Bagian Kanan */} +
+
+ + + +

Simpan

+
+ {/* garis */} +
+ + + {detailDataAudio?.category?.name} + + +
+

poldajabar

+

pilkadamai2024

+
+ +
+ + {/* Opsi Ukuran Foto */} +

Opsi Ukuran Foto

+ +
+ +
+ {sizes.map((size) => ( + + ))} +
+ + {/* Download Semua */} +
+ +
+ + {/* Tombol Download */} + +
+
+ + {/* Footer Informasi */} +
+

+ oleh {detailDataAudio?.uploadedBy?.userLevel?.name} | Diupdate pada {detailDataAudio?.updatedAt} WIB |  + +   + {detailDataAudio?.clickCount} +

+

Kreator: {detailDataAudio?.creatorName}

+
+ + {/* Keterangan */} +
+

{detailDataAudio?.title}

+
+
+
+
+ {/* Comment */} +
+

Berikan Komentar

+