From 5fc867dd12c28941ff70bba443e86c84ba8441df Mon Sep 17 00:00:00 2001 From: Sabda Yagra Date: Tue, 11 Feb 2025 18:16:07 +0700 Subject: [PATCH 1/4] fix: content-management --- .../content-management/download/page.tsx | 214 ++++++++++-------- .../content-management/galery/page.tsx | 211 +++++++++-------- .../content-management/rewrite/page.tsx | 8 +- .../content-management/users/page.tsx | 24 +- components/landing-page/header-management.tsx | 16 +- public/assets/gg-profile.png | Bin 0 -> 812 bytes 6 files changed, 250 insertions(+), 223 deletions(-) create mode 100644 public/assets/gg-profile.png diff --git a/app/[locale]/(public)/content-management/download/page.tsx b/app/[locale]/(public)/content-management/download/page.tsx index 729e70dc..7596e1fa 100644 --- a/app/[locale]/(public)/content-management/download/page.tsx +++ b/app/[locale]/(public)/content-management/download/page.tsx @@ -278,12 +278,13 @@ const Galery = (props: any) => {
-
-
-

Galeri Saya

-
-
+
+
+

+ Galeri + Saya +

{
+
{selectedTab == "video" ? ( contentVideo?.length > 0 ? ( -
+
{contentVideo?.map((video: any) => ( - - + +
- - {/* */} -
- -
- -
{video?.mediaUpload?.title}
- - - - - - - - - -

Content Rewrite

- -
- - - - - -
-

Share Ke Email

-
-

Email Tujuan :

- setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder="Tekan Enter untuk input Email" /> +
+
+ +
+ +

{video?.mediaUpload?.title}

+ +

+ + + + + + + +

handleSaveWishlist(video?.mediaUpload?.id)} className="cursor-pointer flex flex-row gap-2 hover:text-red-800"> + +

Simpan

- -
- - + + +

Content Rewrite

+ +
+ + + + + +
+

Share Ke Email

+
+

Email Tujuan :

+ setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder="Tekan Enter untuk input Email" /> +
+ +
+
+
+
+ + +

- handleDelete(video?.id)} className="flex items-center gap-3 hover:text-red-800 w-full rounded-lg"> - -

Hapus

-
- - +
+
@@ -464,58 +471,65 @@ const Galery = (props: any) => { contentImage?.length > 0 ? (
{contentImage?.map((image: any) => ( - - - - {/* */} -
- -
- -
{image?.mediaUpload?.title}
- - - - - - - - - -

Content Rewrite

- -
- - - - - -
-

Share Ke Email

-
-

Email Tujuan :

- setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder="Tekan Enter untuk input Email" /> -
- -
-
-
+ + +
+
+
+ +
+ +

{image?.mediaUpload?.title}

+ +

+ + + + + + + +

handleSaveWishlist(image?.mediaUpload?.id)} className="cursor-pointer flex flex-row gap-2 hover:text-red-800"> + +

Simpan

+
+ + +

Content Rewrite

+ +
+ + + + + +
+

Share Ke Email

+
+

Email Tujuan :

+ setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder="Tekan Enter untuk input Email" /> +
+ +
+
+
+
+ + +

+
- handleDelete(image?.id)} className="flex items-center gap-3 hover:text-red-800 w-full rounded-lg"> - -

Hapus

-
- - +
+
))} -
+
) : (

empty diff --git a/app/[locale]/(public)/content-management/galery/page.tsx b/app/[locale]/(public)/content-management/galery/page.tsx index adedbe35..3b65bd3f 100644 --- a/app/[locale]/(public)/content-management/galery/page.tsx +++ b/app/[locale]/(public)/content-management/galery/page.tsx @@ -21,6 +21,7 @@ import { Button } from "@/components/ui/button"; import { sendMediaUploadToEmail } from "@/service/media-tracking/media-tracking"; import ImageBlurry from "@/components/ui/image-blurry"; import Image from "next/image"; +import { formatDateToIndonesian } from "@/utils/globals"; const Galery = (props: any) => { const [profile, setProfile] = useState(); @@ -284,12 +285,13 @@ const Galery = (props: any) => {

-
-
-

Galeri {profile?.institute?.name}

-
+
+

+ Galeri + {profile?.institute?.name} +

{
+
{selectedTab == "video" ? ( contentVideo?.length > 0 ? ( -
+
{contentVideo?.map((video: any) => ( - - + +
- - {/* */} -
- -
- -
{video?.mediaUpload?.title}
- - - - - - - -
handleSaveWishlist(video?.mediaUpload?.id)} className="cursor-pointer flex flex-row gap-2 hover:text-red-800"> - -

Simpan

-
- - -

Content Rewrite

- -
- - - - - -
-

Share Ke Email

-
-

Email Tujuan :

- setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder="Tekan Enter untuk input Email" /> +
+
+ +
+ +

{video?.mediaUpload?.title}

+ +

+ + + + + + + +

handleSaveWishlist(video?.mediaUpload?.id)} className="cursor-pointer flex flex-row gap-2 hover:text-red-800"> + +

Simpan

- -
- - + + +

Content Rewrite

+ +
+ + + + + +
+

Share Ke Email

+
+

Email Tujuan :

+ setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder="Tekan Enter untuk input Email" /> +
+ +
+
+
+
+ + +

- - +
+
@@ -468,54 +476,61 @@ const Galery = (props: any) => { contentImage?.length > 0 ? (
{contentImage?.map((image: any) => ( - - - - {/* */} -
- + + +
+
+
+ +
+ +

{image?.mediaUpload?.title}

+ +

+ + + + + + + +

handleSaveWishlist(image?.mediaUpload?.id)} className="cursor-pointer flex flex-row gap-2 hover:text-red-800"> + +

Simpan

+
+ + +

Content Rewrite

+ +
+ + + + + +
+

Share Ke Email

+
+

Email Tujuan :

+ setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder="Tekan Enter untuk input Email" /> +
+ +
+
+
+
+ + +

+
+
- -
{image?.mediaUpload?.title}
- - - - - - - -
handleSaveWishlist(image?.mediaUpload?.id)} className="cursor-pointer flex flex-row gap-2 hover:text-red-800"> - -

Simpan

-
- - -

Content Rewrite

- -
- - - - - -
-

Share Ke Email

-
-

Email Tujuan :

- setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder="Tekan Enter untuk input Email" /> -
- -
-
-
-
-
-
+
))} diff --git a/app/[locale]/(public)/content-management/rewrite/page.tsx b/app/[locale]/(public)/content-management/rewrite/page.tsx index 74230f44..2895572b 100644 --- a/app/[locale]/(public)/content-management/rewrite/page.tsx +++ b/app/[locale]/(public)/content-management/rewrite/page.tsx @@ -200,10 +200,10 @@ const page = () => {
-
-
-

Galeri Content Rewrite

-
+
+

+ Galeri Content Rewrite +

{contentImage?.length > 0 ? (
diff --git a/app/[locale]/(public)/content-management/users/page.tsx b/app/[locale]/(public)/content-management/users/page.tsx index b46bea79..1315ac4f 100644 --- a/app/[locale]/(public)/content-management/users/page.tsx +++ b/app/[locale]/(public)/content-management/users/page.tsx @@ -13,6 +13,7 @@ import { Button } from "@/components/ui/button"; import toast from "react-hot-toast"; import { useToast } from "@/components/ui/use-toast"; import { ToastAction } from "@/components/ui/toast"; +import Image from "next/image"; const page = () => { const [user, setUser] = useState(); @@ -118,25 +119,22 @@ const page = () => {
-

Tim {profile?.institute?.name}

-

{user?.length} Anggota

+

+ Tim + {profile?.institute?.name} +

+

+ {user?.length} Anggota Tim {profile?.institute?.name} +

{user?.map((row: any) => (
-
- - - - -

{row?.fullname}

+
+ +

{row?.fullname}

{row?.username || "username"}

diff --git a/components/landing-page/header-management.tsx b/components/landing-page/header-management.tsx index 1a837457..0311b874 100644 --- a/components/landing-page/header-management.tsx +++ b/components/landing-page/header-management.tsx @@ -67,14 +67,14 @@ const HeaderManagement = () => { return (
{/* Header */} -
+
- avatar + avatar
-

{profile?.fullname}

-

{profile?.username}

-

+

{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 @@ -82,9 +82,9 @@ const HeaderManagement = () => {

- - -

Pengaturan

+ +

Lihat Profil Lengkap

+
diff --git a/public/assets/gg-profile.png b/public/assets/gg-profile.png new file mode 100644 index 0000000000000000000000000000000000000000..0241f48f97d9d4d7616951811acecb9922019a55 GIT binary patch literal 812 zcmV+{1JnG8P)Mc{K~#7F-B^o} z6EO^Z+)%)F5OqMP08;_!fKUPHAnxGO!G;RLRj}#cpn`-74k`$%i9P3)Wv};hpSd@q zi8r>NWyz91z$?c)%mWJKZy>+$LZDW*tu(DXv~tM^x7oNpPY&Y-yo{8_am)_FG{vOU zn9-sJx*H$x=)PquRnVt${kZOsQ1aBu3KQ`?p_mm4^?_WUlft*fNNg3d-9W`OMfVEt z1_QAgNMc-l?ZhI##x@GSK_LjSE7pm&Y|Ydf>kEc8;-!;n+d+*o%MtW7r3FK3Sx8GZ z=z&3OfzpYv1rE@Y_aVcx!vI$|=+2xH?MRT`qiZE{|CJ2P{lW<)tw@5ikovC%de%<`WHIR-dN2Mv~LFk%yiRXvWbO zjS`K|5mnL2`?D3-Tm{auDK!sdr_K z%nqWVL2Rj<>xW>4d|=fjB$Oesm=1&KTcS$RU_NL!!NIQ#+TE31Kp2lynz9%P3*8ml zfr?hHkG6C+n1~h9`Hx+-#&t=^$D^eiyg~Z$$zUcB^f#5U(%^|6G!0(q1EvJw(S13E q{58O0q{ZfXME4JvUe1BMZTtrY%=BUo7AQ*q0000 Date: Sat, 15 Feb 2025 21:43:19 +0700 Subject: [PATCH 2/4] feat: adjust landing --- .../[polda_name]/audio/detail/[slug]/page.tsx | 309 +++++++++- .../document/detail/[slug]/page.tsx | 559 +++++++++++++++++- .../(public)/audio/detail/[slug]/page.tsx | 15 +- app/[locale]/(public)/contact/page.tsx | 140 ++++- .../content-management/download/page.tsx | 99 ++-- .../content-management/galery/page.tsx | 63 +- .../rewrite/create/[id]/page.tsx | 45 +- .../rewrite/detail/[id]/page.tsx | 3 - .../content-management/rewrite/page.tsx | 98 +-- .../content-management/users/page.tsx | 20 +- .../(public)/document/detail/[slug]/page.tsx | 14 +- app/[locale]/(public)/faqs/page.tsx | 21 +- app/[locale]/(public)/feedback/page.tsx | 13 +- .../(public)/image/detail/[slug]/page.tsx | 11 +- app/[locale]/(public)/inbox/page.tsx | 10 +- app/[locale]/(public)/inbox/update/page.tsx | 12 +- .../(public)/profile/change-password/page.tsx | 73 +-- .../(public)/profile/change-profile/page.tsx | 16 +- app/[locale]/(public)/profile/page.tsx | 159 +---- .../(public)/video/detail/[slug]/page.tsx | 13 +- components/landing-page/content-category.tsx | 2 +- components/landing-page/footer.tsx | 2 +- .../landing-page/header-banner-satker.tsx | 166 ++++-- components/landing-page/header-banner.tsx | 165 ++++-- components/landing-page/header-management.tsx | 6 +- components/landing-page/navbar.tsx | 8 +- .../landing-page/sidebar-management.tsx | 22 +- components/landing-page/welcome-polda.tsx | 24 +- components/landing-page/welcome-satker.tsx | 24 +- messages/en.json | 65 +- messages/in.json | 70 ++- service/auth.ts | 5 + service/landing/landing.ts | 5 + utils/globals.tsx | 38 +- 34 files changed, 1716 insertions(+), 579 deletions(-) diff --git a/app/[locale]/(public)/(polda)/polda/[polda_name]/audio/detail/[slug]/page.tsx b/app/[locale]/(public)/(polda)/polda/[polda_name]/audio/detail/[slug]/page.tsx index fffbae98..3f1e5ddf 100644 --- a/app/[locale]/(public)/(polda)/polda/[polda_name]/audio/detail/[slug]/page.tsx +++ b/app/[locale]/(public)/(polda)/polda/[polda_name]/audio/detail/[slug]/page.tsx @@ -8,13 +8,20 @@ import { Link, useRouter } from "@/i18n/routing"; import { Textarea } from "@/components/ui/textarea"; import { BarWave } from "react-cssfx-loading"; import { useToast } from "@/components/ui/use-toast"; -import { checkWishlistStatus, deleteWishlist, getDetail, saveWishlist } from "@/service/landing/landing"; +import { checkWishlistStatus, createPublicSuggestion, deletePublicSuggestion, deleteWishlist, getDetail, getPublicSuggestionList, saveWishlist } from "@/service/landing/landing"; import { getCookiesDecrypt } from "@/lib/utils"; -import { close, error, loading } from "@/config/swal"; +import { close, error, loading, warning } from "@/config/swal"; +import { useTranslations } from "next-intl"; +import { checkMaliciousText, getPublicLocaleTimestamp } from "@/utils/globals"; +import withReactContent from "sweetalert2-react-content"; +import Swal from "sweetalert2"; +import parse from "html-react-parser"; + const DetailAudio = () => { const [selectedSize, setSelectedSize] = useState("L"); const [selectedTab, setSelectedTab] = useState("video"); + const t = useTranslations("LandingPage"); const router = useRouter(); const pathname = usePathname(); const params = useParams(); @@ -29,6 +36,11 @@ const DetailAudio = () => { const [main, setMain] = useState(); const [resolutionSelected, setResolutionSelected] = useState("720"); const [imageSizeSelected, setImageSizeSelected] = useState("l"); + const [message, setMessage] = useState(""); + const userRoleId = getCookiesDecrypt("urie"); + const [listSuggestion, setListSuggestion] = useState(); + const [visibleInput, setVisibleInput] = useState(null); + const MySwal = withReactContent(Swal); const userId = getCookiesDecrypt("uie"); @@ -215,7 +227,120 @@ const DetailAudio = () => { { label: "S", value: "1066 x 599 px" }, { label: "XS", value: "800 x 450 px" }, ]; + async function sendSuggestionParent() { + if (message?.length > 3) { + loading(); + const data = { + mediaUploadId: slug?.split("-")?.[0], + message, + parentId: null, + }; + const response = await createPublicSuggestion(data); + + console.log(response); + setMessage(""); + + const responseGet = await getPublicSuggestionList(slug?.split("-")?.[0]); + console.log(responseGet?.data?.data); + setListSuggestion(responseGet?.data?.data); + + // Hapus nilai semua input secara manual jika perlu + const inputs = document.querySelectorAll("input"); + inputs.forEach((input) => { + input.value = ""; + }); + + close(); + } + } + const getInputValue = (e: any) => { + const message = e.target.value; + console.log(message); + setMessage(message); + }; + const postData = () => { + const checkMessage = checkMaliciousText(message); + if (checkMessage == "") { + if (Number(userRoleId) < 1 || userRoleId == undefined) { + router.push("/auth"); + } else { + sendSuggestionParent(); + } + } else { + warning(checkMessage); + } + }; + function addDefaultProfile(ev: any) { + ev.target.src = "/assets/avatar-profile.png"; + } + const showInput = (e: any) => { + console.log(document.querySelector(`#${e}`)?.classList); + document.querySelector(`#${e}`)?.classList.toggle("none"); + setVisibleInput(visibleInput === e ? null : e); + }; + async function sendSuggestionChild(parentId: any) { + const inputElement = document.querySelector(`#input-comment-${parentId}`) as HTMLInputElement; + + if (inputElement && inputElement.value.length > 3) { + loading(); + const data = { + mediaUploadId: slug?.split("-")?.[0], + message: inputElement.value, + parentId, + }; + + console.log(data); + const response = await createPublicSuggestion(data); + console.log(response); + const responseGet: any = await getPublicSuggestionList(slug?.split("-")?.[0]); + console.log(responseGet.data?.data); + setListSuggestion(responseGet.data?.data); + + // Reset input field + inputElement.value = ""; + + // document.querySelector("#comment-id-" + parentId)?.style.display = "none"; + + close(); + } + } + async function deleteDataSuggestion(dataId: any) { + loading(); + const response = await deletePublicSuggestion(dataId); + console.log(response); + const responseGet = await getPublicSuggestionList(slug.split("-")?.[0]); + console.log(responseGet.data?.data); + setListSuggestion(responseGet.data?.data); + close(); + } + const deleteData = (dataId: any) => { + MySwal.fire({ + title: "Delete Comment", + icon: "warning", + showCancelButton: true, + cancelButtonColor: "#3085d6", + confirmButtonColor: "#d33", + confirmButtonText: "Delete", + }).then((result: any) => { + if (result.isConfirmed) { + deleteDataSuggestion(dataId); + console.log(dataId); + } + }); + }; + const postDataChild = (id: any) => { + const checkMessage = checkMaliciousText(message); + if (checkMessage == "") { + if (Number(userRoleId) < 1 || userRoleId == undefined) { + router.push("/auth"); + } else { + sendSuggestionChild(id); + } + } else { + warning(checkMessage); + } + }; return ( <>
@@ -316,10 +441,188 @@ const DetailAudio = () => {
{/* Comment */} -
+ {/*

Berikan Komentar

+ +
-
+ ); }; diff --git a/app/[locale]/(public)/content-management/download/page.tsx b/app/[locale]/(public)/content-management/download/page.tsx index 7596e1fa..0d4876e4 100644 --- a/app/[locale]/(public)/content-management/download/page.tsx +++ b/app/[locale]/(public)/content-management/download/page.tsx @@ -5,7 +5,7 @@ import { checkWishlistStatus, deleteWishlist, getInfoProfile, mediaWishlist, sav import React, { useEffect, useState } from "react"; import { Link, useRouter } from "@/i18n/routing"; import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs"; -import { useSearchParams } from "next/navigation"; +import { usePathname, useSearchParams } from "next/navigation"; import { Card, CardContent } from "@/components/ui/card"; import HeaderManagement from "@/components/landing-page/header-management"; import SidebarManagement from "@/components/landing-page/sidebar-management"; @@ -19,6 +19,7 @@ import { Button } from "@/components/ui/button"; import { sendMediaUploadToEmail } from "@/service/media-tracking/media-tracking"; import ImageBlurry from "@/components/ui/image-blurry"; import Image from "next/image"; +import { useTranslations } from "next-intl"; const Galery = (props: any) => { const [profile, setProfile] = useState(); @@ -26,6 +27,7 @@ const Galery = (props: any) => { const router = useRouter(); const MySwal = withReactContent(Swal); const searchParams = useSearchParams(); + const pathname = usePathname(); const page: any = searchParams?.get("page"); const title = searchParams?.get("title"); const category = searchParams?.get("category"); @@ -50,6 +52,7 @@ const Galery = (props: any) => { const [emailShareInput, setEmailShareInput] = useState(); const [emailMessageInput, setEmailMessageInput] = useState(); const id = searchParams?.get("id"); + const t = useTranslations("LandingPage"); useEffect(() => { getDataVideo(); @@ -282,37 +285,49 @@ const Galery = (props: any) => {

- Galeri - Saya + {/* Galeri + Saya */} + {pathname?.split("/")[1] == "in" ? ( + <> + {t("gallery")}  + {t("my")} + + ) : ( + <> + {t("my")}  + {t("gallery")} + + )}

+ - Foto + {t("image")}
|
- Audio Visual + {t("video")}
|
- Teks + {t("text")}
|
- Audio + {t("audio")}
@@ -343,7 +358,7 @@ const Galery = (props: any) => {
handleSaveWishlist(video?.mediaUpload?.id)} className="cursor-pointer flex flex-row gap-2 hover:text-red-800"> -

Simpan

+

{t("save")}

@@ -354,18 +369,18 @@ const Galery = (props: any) => {
-

Share Ke Email

+

{t("shareTo")}

-

Email Tujuan :

- setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder="Tekan Enter untuk input Email" /> +

{t("destinationEmail")}

+ setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder={t("pressEnter")} />
@@ -421,12 +436,16 @@ const Galery = (props: any) => {
- + +
handleSaveWishlist(audio?.mediaUpload?.id)} className="cursor-pointer flex flex-row gap-2 hover:text-red-800"> + +

{t("save")}

+

Content Rewrite

@@ -434,29 +453,25 @@ const Galery = (props: any) => {
-
-

Share Ke Email

+

{t("shareTo")}

-

Email Tujuan :

- setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder="Tekan Enter untuk input Email" /> +

{t("destinationEmail")}

+ setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder={t("pressEnter")} />
- handleDelete(audio?.id)} className="flex items-center gap-3 hover:text-red-800 w-full rounded-lg"> - -

Hapus

-
@@ -491,7 +506,7 @@ const Galery = (props: any) => {
handleSaveWishlist(image?.mediaUpload?.id)} className="cursor-pointer flex flex-row gap-2 hover:text-red-800"> -

Simpan

+

{t("save")}

@@ -502,18 +517,18 @@ const Galery = (props: any) => {
-

Share Ke Email

+

{t("shareTo")}

-

Email Tujuan :

- setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder="Tekan Enter untuk input Email" /> +

{t("destinationEmail")}

+ setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder={t("pressEnter")} />
@@ -529,7 +544,7 @@ const Galery = (props: any) => { ))} -
+
) : (

empty @@ -556,7 +571,7 @@ const Galery = (props: any) => { - Download Dokumen + Download {t("document")}

@@ -566,6 +581,10 @@ const Galery = (props: any) => { +
handleSaveWishlist(document?.mediaUpload?.id)} className="cursor-pointer flex flex-row gap-2 hover:text-red-800"> + +

{t("save")}

+

Content Rewrite

@@ -573,29 +592,25 @@ const Galery = (props: any) => {
-
-

Share Ke Email

+

{t("shareTo")}

-

Email Tujuan :

- setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder="Tekan Enter untuk input Email" /> +

{t("destinationEmail")}

+ setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder={t("pressEnter")} />
- handleDelete(document?.id)} className="flex items-center gap-3 hover:text-red-800 w-full rounded-lg"> - -

Hapus

-
diff --git a/app/[locale]/(public)/content-management/galery/page.tsx b/app/[locale]/(public)/content-management/galery/page.tsx index 3b65bd3f..05b566ba 100644 --- a/app/[locale]/(public)/content-management/galery/page.tsx +++ b/app/[locale]/(public)/content-management/galery/page.tsx @@ -21,7 +21,7 @@ import { Button } from "@/components/ui/button"; import { sendMediaUploadToEmail } from "@/service/media-tracking/media-tracking"; import ImageBlurry from "@/components/ui/image-blurry"; import Image from "next/image"; -import { formatDateToIndonesian } from "@/utils/globals"; +import { useTranslations } from "next-intl"; const Galery = (props: any) => { const [profile, setProfile] = useState(); @@ -54,6 +54,7 @@ const Galery = (props: any) => { const [emailShareInput, setEmailShareInput] = useState(); const [emailMessageInput, setEmailMessageInput] = useState(); const id = searchParams?.get("id"); + const t = useTranslations("LandingPage"); useEffect(() => { getDataVideo(); @@ -289,7 +290,7 @@ const Galery = (props: any) => {

- Galeri + {t("gallery")} {profile?.institute?.name}

@@ -298,28 +299,28 @@ const Galery = (props: any) => { value="image" className="relative text-xs md:text-xl font-bold text-black dark:text-white dark:bg-transparent before:absolute before:top-full before:left-0 before:h-px before:w-full data-[state=active]:before:bg-primary" > - Foto + {t("image")}
|
- Audio Visual + {t("video")}
|
- Teks + {t("text")}
|
- Audio + {t("audio")}
@@ -350,7 +351,7 @@ const Galery = (props: any) => {
handleSaveWishlist(video?.mediaUpload?.id)} className="cursor-pointer flex flex-row gap-2 hover:text-red-800"> -

Simpan

+

{t("save")}

@@ -361,18 +362,18 @@ const Galery = (props: any) => {
-

Share Ke Email

+

{t("shareTo")}

-

Email Tujuan :

- setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder="Tekan Enter untuk input Email" /> +

{t("destinationEmail")}

+ setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder={t("shareTo")} />
@@ -434,7 +435,7 @@ const Galery = (props: any) => {
handleSaveWishlist(audio?.mediaUpload?.id)} className="cursor-pointer flex flex-row gap-2 hover:text-red-800"> -

Simpan

+

{t("save")}

@@ -445,18 +446,18 @@ const Galery = (props: any) => {
-

Share Ke Email

+

{t("shareTo")}

-

Email Tujuan :

- setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder="Tekan Enter untuk input Email" /> +

{t("destinationEmail")}

+ setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder={t("pressEnter")} />
@@ -496,7 +497,7 @@ const Galery = (props: any) => {
handleSaveWishlist(image?.mediaUpload?.id)} className="cursor-pointer flex flex-row gap-2 hover:text-red-800"> -

Simpan

+

{t("save")}

@@ -507,18 +508,18 @@ const Galery = (props: any) => {
-

Share Ke Email

+

{t("shareTo")}

-

Email Tujuan :

- setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder="Tekan Enter untuk input Email" /> +

{t("destinationEmail")}

+ setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder={t("pressEnter")} />
@@ -561,7 +562,7 @@ const Galery = (props: any) => { - Download Dokumen + Download {t("document")}
@@ -573,7 +574,7 @@ const Galery = (props: any) => {
handleSaveWishlist(document?.mediaUpload?.id)} className="cursor-pointer flex flex-row gap-2 hover:text-red-800"> -

Simpan

+

{t("save")}

@@ -584,18 +585,18 @@ const Galery = (props: any) => {
-

Share Ke Email

+

{t("shareTo")}

-

Email Tujuan :

- setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder="Tekan Enter untuk input Email" /> +

{t("destinationEmail")}

+ setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder={t("pressEnter")} />
diff --git a/app/[locale]/(public)/content-management/rewrite/create/[id]/page.tsx b/app/[locale]/(public)/content-management/rewrite/create/[id]/page.tsx index 1c1f8d15..a982672d 100644 --- a/app/[locale]/(public)/content-management/rewrite/create/[id]/page.tsx +++ b/app/[locale]/(public)/content-management/rewrite/create/[id]/page.tsx @@ -21,10 +21,10 @@ import { getPublicSuggestionList } from "@/service/landing/landing"; import { getDetail } from "@/service/detail/detail"; import { yupResolver } from "@hookform/resolvers/yup"; import * as Yup from "yup"; -import { htmlToString } from "@/utils/globals"; import Cookies from "js-cookie"; import { Input } from "@/components/ui/input"; import { Textarea } from "@/components/ui/textarea"; +import { useTranslations } from "next-intl"; const imageSchema = z.object({ title: z.string().min(1, { message: "Judul diperlukan" }), @@ -63,6 +63,7 @@ const page = (props: any) => { const [isLoadingData, setIsLoadingData] = useState(false); const [detailData, setDetailData] = useState(null); const [articleImages, setArticleImages] = useState([]); + const t = useTranslations("LandingPage"); const userLevelId = getCookiesDecrypt("ulie"); const roleId = getCookiesDecrypt("urie"); @@ -293,21 +294,21 @@ const page = (props: any) => {
-
Content Rewrite
+
{t("content")} Rewrite
{content && (
-

Bahasa

+

{t("language")}

-

Context Type

+

{t("contextType")}

-

Writing Style

+

{t("writingStyle")}

-

Article Size

+

{t("articleSize")}

setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder="Tekan Enter untuk input Email" /> +
+ +

{image?.title}

+ +

+ + + + + + + +

handleSaveWishlist(image?.mediaUpload?.id)} className="cursor-pointer flex flex-row gap-2 hover:text-red-800"> + +

{t("save")}

- -
- - + + +

Content Rewrite

+ +
+ + + + + +
+

{t("shareTo")}

+
+

{t("destinationEmail")}

+ setEmailShareInput(event.target.value)} onKeyPress={handleEmailList} type="email" placeholder={t("pressEnter")} /> +
+ +
+
+
+
+ + +

- handleDelete(image?.id)} className="flex items-center gap-1 hover:text-red-800 w-full rounded-lg"> - -

Hapus

-
- - +
+
diff --git a/app/[locale]/(public)/content-management/users/page.tsx b/app/[locale]/(public)/content-management/users/page.tsx index 1315ac4f..6f047011 100644 --- a/app/[locale]/(public)/content-management/users/page.tsx +++ b/app/[locale]/(public)/content-management/users/page.tsx @@ -2,7 +2,7 @@ import HeaderManagement from "@/components/landing-page/header-management"; import SidebarManagement from "@/components/landing-page/sidebar-management"; -import { close, error, loading } from "@/config/swal"; +import { close, loading } from "@/config/swal"; import { getCookiesDecrypt } from "@/lib/utils"; import { getInfoProfile, getUsersTeams, saveUserReports } from "@/service/landing/landing"; import React, { useEffect, useState } from "react"; @@ -10,10 +10,9 @@ import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, Di import withReactContent from "sweetalert2-react-content"; import Swal from "sweetalert2"; import { Button } from "@/components/ui/button"; -import toast from "react-hot-toast"; import { useToast } from "@/components/ui/use-toast"; -import { ToastAction } from "@/components/ui/toast"; import Image from "next/image"; +import { useTranslations } from "next-intl"; const page = () => { const [user, setUser] = useState(); @@ -24,6 +23,7 @@ const page = () => { const MySwal = withReactContent(Swal); const { toast } = useToast(); const [reportMessageOpen, setReportMessageOpen] = useState(false); + const t = useTranslations("LandingPage"); // const launchModal = (user: any) => { // setUserSelected(user); @@ -120,11 +120,11 @@ const page = () => {

- Tim + {t("team")} {profile?.institute?.name}

- {user?.length} Anggota Tim {profile?.institute?.name} + {user?.length} {t("teamMembers")} {profile?.institute?.name}

@@ -164,7 +164,7 @@ const page = () => {
-

Alasan Report Akun

+

{t("reasonReport")}