diff --git a/app/[locale]/(public)/content-management/download/page.tsx b/app/[locale]/(public)/content-management/download/page.tsx new file mode 100644 index 00000000..cc28936a --- /dev/null +++ b/app/[locale]/(public)/content-management/download/page.tsx @@ -0,0 +1,17 @@ +import HeaderManagement from "@/components/landing-page/header-management"; +import SidebarManagement from "@/components/landing-page/sidebar-management"; +import React from "react"; + +const page = () => { + return ( + <> + +
+ +
{profile?.fullname}
{profile?.username}
- Aktif Sejak - {`${new Date(profile?.createdAt).getDate()}/${new Date(profile?.createdAt).getMonth() + 1}/${new Date(profile?.createdAt).getFullYear()} ${new Date(profile?.createdAt).getHours()}:${new Date( - profile?.createdAt - ).getMinutes()}`} -
Email :
msabdayagra@gmail.com
{profile?.email}
No Handphone :
0812-7561-7204
{profile?.phoneNumber}
Alamat :
Jl. Besar Tembung no.12
{profile?.address}
Kategori :
POLRI
{profile?.institute?.categoryRole?.name}
Instansi/Perusahaan :
Div Humas Polri
{profile?.institute?.name}
Galeri {profile?.institute?.name}
Galeri Saya
Galeri Rewrite
Tim Pengguna
- -
+ Aktif Sejak + {`${new Date(profile?.createdAt).getDate()}/${new Date(profile?.createdAt).getMonth() + 1}/${new Date(profile?.createdAt).getFullYear()} ${new Date(profile?.createdAt).getHours()}:${new Date( + profile?.createdAt + ).getMinutes()}`} +
Video
Audio
Foto
Teks @@ -214,14 +138,7 @@ const Navbar = () => { - + { - + { - + {/* Tombol Utama */} - setIsOpen(!isOpen)} - className="flex items-center space-x-2 p-2 text-gray-700 bg-slate-200 rounded-lg" - > + setIsOpen(!isOpen)} className="flex items-center space-x-2 p-2 text-gray-700 bg-slate-200 rounded-lg"> {language === "id" ? "Ind" : "Eng"} - - + + @@ -306,30 +198,12 @@ const Navbar = () => { {/* Dropdown Menu */} {isOpen && ( - handleLanguageChange("id")} - className={`flex items-center space-x-2 w-full px-4 py-2 ${ - language === "id" ? "font-medium" : "" - }`} - > - + handleLanguageChange("id")} className={`flex items-center space-x-2 w-full px-4 py-2 ${language === "id" ? "font-medium" : ""}`}> + Ind - handleLanguageChange("en")} - className={`flex items-center space-x-2 w-full px-4 py-2 ${ - language === "en" ? "font-medium" : "" - }`} - > - + handleLanguageChange("en")} className={`flex items-center space-x-2 w-full px-4 py-2 ${language === "en" ? "font-medium" : ""}`}> + Eng @@ -337,18 +211,9 @@ const Navbar = () => { - + - + { )} */} - {roleId === "5" || - roleId === "6" || - roleId === "7" || - roleId === "8" ? ( + {roleId === "5" || roleId === "6" || roleId === "7" || roleId === "8" ? ( {detail !== undefined ? ( - + - - {detail?.fullname} - + {detail?.fullname} ({detail?.fullname}) @@ -443,14 +297,10 @@ const Navbar = () => { { name: "Kelola Konten", icon: "stash:save-ribbon-duotone", - href: "/content-management", + href: "/content-management/galery", }, ].map((item, index) => ( - + {item.name} @@ -462,11 +312,7 @@ const Navbar = () => { - + Log out @@ -475,30 +321,15 @@ const Navbar = () => { - ) : roleId === "2" || - roleId === "3" || - roleId === "4" || - roleId === "9" || - roleId === "10" || - roleId === "11" || - roleId === "12" || - roleId === "13" ? ( + ) : roleId === "2" || roleId === "3" || roleId === "4" || roleId === "9" || roleId === "10" || roleId === "11" || roleId === "12" || roleId === "13" ? ( // Dropdown menu for roleId === 3 {detail !== undefined ? ( - + - - {detail?.fullname} - + {detail?.fullname} ({detail?.fullname}) @@ -523,11 +354,7 @@ const Navbar = () => { href: "/dashboard", }, ].map((item, index) => ( - + {item.name} @@ -539,11 +366,7 @@ const Navbar = () => { - + Log out @@ -555,16 +378,10 @@ const Navbar = () => { ) : ( // Masuk and Daftar buttons for roleId === null - + Masuk - + Daftar @@ -580,14 +397,7 @@ const Navbar = () => { - + { - - router.push( - generateLocalizedPath("/video/filter", String(locale)) - ) - } - className="flex items-start gap-1.5 p-2 hover:bg-white" - > + router.push(generateLocalizedPath("/video/filter", String(locale)))} className="flex items-start gap-1.5 p-2 hover:bg-white"> Video - - router.push( - generateLocalizedPath("/audio/filter", String(locale)) - ) - } - className="flex place-items-start gap-1.5 p-2 hover:bg-white" - > + router.push(generateLocalizedPath("/audio/filter", String(locale)))} className="flex place-items-start gap-1.5 p-2 hover:bg-white"> Audio - - router.push( - generateLocalizedPath("/image/filter", String(locale)) - ) - } - className="flex place-items-start gap-1.5 p-2 hover:bg-white" - > + router.push(generateLocalizedPath("/image/filter", String(locale)))} className="flex place-items-start gap-1.5 p-2 hover:bg-white"> Foto - - router.push( - generateLocalizedPath( - "/document/filter", - String(locale) - ) - ) - } - className="flex place-items-start gap-1.5 p-2 hover:bg-white" - > + router.push(generateLocalizedPath("/document/filter", String(locale)))} className="flex place-items-start gap-1.5 p-2 hover:bg-white"> Teks @@ -658,14 +437,7 @@ const Navbar = () => { - + { - + { - + {/* Tombol Utama Bahasa */} - setIsOpen(!isOpen)} - className="flex items-center space-x-2 p-2 text-gray-700 bg-slate-200 rounded-lg" - > + setIsOpen(!isOpen)} className="flex items-center space-x-2 p-2 text-gray-700 bg-slate-200 rounded-lg"> {language === "id" ? "Ind" : "Eng"} - - + + @@ -749,30 +496,12 @@ const Navbar = () => { {/* Dropdown Menu */} {isOpen && ( - handleLanguageChange("id")} - className={`flex items-center space-x-2 w-full px-4 py-2 ${ - language === "id" ? "font-medium" : "" - }`} - > - + handleLanguageChange("id")} className={`flex items-center space-x-2 w-full px-4 py-2 ${language === "id" ? "font-medium" : ""}`}> + Ind - handleLanguageChange("en")} - className={`flex items-center space-x-2 w-full px-4 py-2 ${ - language === "en" ? "font-medium" : "" - }`} - > - + handleLanguageChange("en")} className={`flex items-center space-x-2 w-full px-4 py-2 ${language === "en" ? "font-medium" : ""}`}> + Eng @@ -781,22 +510,14 @@ const Navbar = () => { - + {fullName ? ( <> - + {fullName} {`(${roleName})`} @@ -804,28 +525,19 @@ const Navbar = () => { - + Profile - + Kelola Konten - + Keluar @@ -835,16 +547,10 @@ const Navbar = () => { > ) : ( <> - + Masuk - + Daftar {" "} > diff --git a/components/landing-page/sidebar-management.tsx b/components/landing-page/sidebar-management.tsx new file mode 100644 index 00000000..fdfa3194 --- /dev/null +++ b/components/landing-page/sidebar-management.tsx @@ -0,0 +1,147 @@ +"use client"; + +import { Link, usePathname } from "@/i18n/routing"; +import { getInfoProfile, getListPorvinces, getUsersTeams } from "@/service/landing/landing"; +import { Icon } from "@iconify/react/dist/iconify.js"; +import React, { useEffect, useState } from "react"; +import { useParams } from "next/navigation"; + +const SidebarManagement = () => { + const [profile, setProfile] = useState(); + const [province, setProvince] = useState([]); + const [, setUser] = useState(); + const [selectedTab, setSelectedTab] = useState("video"); + const params = useParams(); + const pathname = usePathname(); + + // const currentRoute = router.pathname; + // const profilePicture = Cookies.get("profile_picture"); + + useEffect(() => { + async function initState() { + const response = await getInfoProfile(); + setProfile(response?.data?.data); + } + + async function getProvinces() { + const response = await getListPorvinces(); + + // console.log(response?.data.data); + setProvince(response?.data?.data); + } + + // async function getDisticts() { + // const response = await getListDistricts(); + // console.log(response?.data.data); + // setDistrict(response?.data.data); + // } + initState(); + getProvinces(); // getDisticts(); + }, []); + + useEffect(() => { + async function initState() { + if (profile != undefined) { + const response = await getUsersTeams(profile?.instituteId); + + // console.log(response?.data?.data); + setUser(response?.data?.data); + } + } + + initState(); + }, [profile]); + + function addDefaultProfile(ev: any) { + ev.target.src = "/assets/avatar-profile.png"; + } + + const [hasMounted, setHasMounted] = useState(false); + // Hooks + useEffect(() => { + setHasMounted(true); + }, []); + + // Render + if (!hasMounted) return null; + return ( + + + Tentang Saya + + + + Email : + {profile?.email} + + + No Handphone : + {profile?.phoneNumber} + + + Alamat : + {profile?.address} + + + Kategori : + {profile?.institute?.categoryRole?.name} + + + Instansi/Perusahaan : + {profile?.institute?.name} + + + + + + + + + + + Galeri {profile?.institute?.name} + + + + + + + + + + + Galeri Saya + + + + + + + + + + + Galeri Rewrite + + + + + + + + + + + Tim Pengguna + + + + + + + + + ); +}; + +export default SidebarManagement; diff --git a/service/landing/landing.ts b/service/landing/landing.ts index 203b9c7d..cd52cd0d 100644 --- a/service/landing/landing.ts +++ b/service/landing/landing.ts @@ -69,9 +69,24 @@ export async function getInfoProfile() { } export async function getListPorvinces() { - return await httpGetInterceptor(`public/users/provinces`) + return await httpGetInterceptor(`public/users/provinces`); } export async function getUsersTeams(id: any) { - return await httpGetInterceptor(`users?instituteId=${id}`) -} \ No newline at end of file + return await httpGetInterceptor(`users?instituteId=${id}`); +} +export async function mediaWishlist(type: any, instituteId: any, search: any, category: any, size: string, page: number, sortBy: undefined, format: string) { + return await httpGetInterceptor(`/media/wishlist/list?enablePage=1&size=${size}&page=${page}&typeId=${type}&instituteId=${instituteId}`); +} + +export async function checkWishlistStatus(mediaId: any) { + return await httpGetInterceptor(`/media/wishlist/status?mediaId=${mediaId}`); +} + +export async function saveWishlist(data: any) { + return await httpGetInterceptor(`/media/wishlist`); +} + +export async function deleteWishlist(id: any) { + return await httpGetInterceptor(`media/wishlist?id=${id}`); +}
({detail?.fullname})
Teks @@ -658,14 +437,7 @@ const Navbar = () => { - + { - + {
{fullName}
{`(${roleName})`}