From 68b9439f23cbd1b5beed3c2531d9e01f7f26ba7a Mon Sep 17 00:00:00 2001 From: Sabda Yagra Date: Mon, 17 Nov 2025 17:53:16 +0700 Subject: [PATCH] fix: all filter card --- .../admin/add-experts/update/[id]/page.tsx | 21 ++++++++++++++++++- .../filter-all/audio-filter-card.tsx | 15 ++++++++++--- .../filter-all/document-filter-card.tsx | 15 ++++++++++--- .../filter-all/image-filter-card.tsx | 16 +++++++++++--- .../filter-all/video-filter-card.tsx | 15 ++++++++++--- components/landing-page/navbar.tsx | 2 +- 6 files changed, 70 insertions(+), 14 deletions(-) diff --git a/app/[locale]/(protected)/admin/add-experts/update/[id]/page.tsx b/app/[locale]/(protected)/admin/add-experts/update/[id]/page.tsx index de79e295..9a161fb5 100644 --- a/app/[locale]/(protected)/admin/add-experts/update/[id]/page.tsx +++ b/app/[locale]/(protected)/admin/add-experts/update/[id]/page.tsx @@ -160,6 +160,25 @@ export default function UpdateExpertForm() { initState(); }, [id]); + useEffect(() => { + if (!detail) return; + + form.reset({ + name: detail.fullname || "", + username: detail.username || "", + phoneNumber: detail.phoneNumber || "", + email: detail.email || "", + password: "", + skills: detail?.userProfilesAdditional?.userCompetency?.id + ? String(detail.userProfilesAdditional.userCompetency.id) + : "", + experiences: detail?.userProfilesAdditional?.userExperienceId + ? String(detail.userProfilesAdditional.userExperienceId) + : "", + company: detail?.userProfilesAdditional?.companyName || "", + }); + }, [detail]); + if (!detail) return
Loading...
; const togglePasswordType = () => { @@ -644,7 +663,7 @@ export default function UpdateExpertForm() { type="button" size="md" onClick={handleAddRow} - disabled={placementRows.length >= 2} // optional: disable button if already 1 row added + disabled={placementRows.length >= 2} > Tambah diff --git a/components/landing-page/filter-all/audio-filter-card.tsx b/components/landing-page/filter-all/audio-filter-card.tsx index 1c9bf406..5b805236 100644 --- a/components/landing-page/filter-all/audio-filter-card.tsx +++ b/components/landing-page/filter-all/audio-filter-card.tsx @@ -288,9 +288,18 @@ export default function FilterAudioComponent(props: { {/* Caption */}
-

- {audio?.categoryName?.toUpperCase() ?? "GIAT PIMPINAN"} -

+
+

+ {audio?.categoryName?.toUpperCase() ?? "GIAT PIMPINAN"} +

+ +

+ {formatDateToIndonesian(new Date(audio?.createdAt))}{" "} + {audio?.timezone ? audio?.timezone : "WIB"} |{" "} + {" "} + {audio?.clickCount}{" "} +

+

{audio?.title} diff --git a/components/landing-page/filter-all/document-filter-card.tsx b/components/landing-page/filter-all/document-filter-card.tsx index 69630cfc..b764a605 100644 --- a/components/landing-page/filter-all/document-filter-card.tsx +++ b/components/landing-page/filter-all/document-filter-card.tsx @@ -259,9 +259,18 @@ export default function FilterDocumentComponent(props: { {/* Konten bawah */}

- {/* Kategori merah */} -
- {text?.categoryName?.toUpperCase() ?? "Text"} +
+ {/* Kategori merah */} +
+ {text?.categoryName?.toUpperCase() ?? "Text"} +
+ +

+ {formatDateToIndonesian(new Date(text?.createdAt))}{" "} + {text?.timezone ? text?.timezone : "WIB"} |{" "} + {" "} + {text?.clickCount}{" "} +

{/* Judul */} diff --git a/components/landing-page/filter-all/image-filter-card.tsx b/components/landing-page/filter-all/image-filter-card.tsx index 2ce7cfa6..7638c796 100644 --- a/components/landing-page/filter-all/image-filter-card.tsx +++ b/components/landing-page/filter-all/image-filter-card.tsx @@ -6,6 +6,7 @@ import { CarouselNext, CarouselPrevious, } from "@/components/ui/carousel"; +import { Icon } from "@/components/ui/icon"; import { close, loading } from "@/config/swal"; import { Link, usePathname, useRouter } from "@/i18n/routing"; import { listData, listDataRegional } from "@/service/landing/landing"; @@ -259,9 +260,18 @@ export default function FilterImageComponent(props: { {/* Caption section */}
-

- {image?.categoryName?.toUpperCase() ?? "Giat Pimpinan"} -

+
+

+ {image?.categoryName?.toUpperCase() ?? "Giat Pimpinan"} +

+

+ {formatDateToIndonesian(new Date(image?.createdAt))}{" "} + {image?.timezone ? image?.timezone : "WIB"}{" "}|{" "} + {" "} + {image?.clickCount}{" "} +

+
+

-

- {video?.categoryName?.toUpperCase() ?? "Giat Pimpinan"} -

+
+

+ {video?.categoryName?.toUpperCase() ?? "Giat Pimpinan"} +

+

+ {formatDateToIndonesian(new Date(video?.createdAt))}{" "} + {video?.timezone ? video?.timezone : "WIB"} |{" "} + {" "} + {video?.clickCount}{" "} +

+
+

{video?.title}

diff --git a/components/landing-page/navbar.tsx b/components/landing-page/navbar.tsx index 741f68ab..52f1c8f6 100644 --- a/components/landing-page/navbar.tsx +++ b/components/landing-page/navbar.tsx @@ -209,7 +209,7 @@ const Navbar = () => {
- +