From 2db82ec7d1b5fff0fb514932db680f616e80b698 Mon Sep 17 00:00:00 2001 From: Bagasbanuna02 Date: Mon, 24 Mar 2025 15:42:11 +0800 Subject: [PATCH] fix admin voting - fix admin detail review & reject --- .../admin/vote/child/table_reject/index.tsx | 55 ++--- .../admin/vote/child/table_review/index.tsx | 53 ++-- .../button/comp_button_detail_reject.tsx | 115 +++++++++ .../button/comp_button_detail_review.tsx | 228 ++++++++++++++++++ .../component/{detail.tsx => comp_detail.tsx} | 0 ...mp_publish.tsx => comp_detail_publish.tsx} | 4 +- .../vote/component/comp_detail_reject.tsx | 51 ++++ .../vote/component/comp_detail_review.tsx | 21 ++ .../admin/vote/detail/detail_voting.tsx | 10 +- 9 files changed, 463 insertions(+), 74 deletions(-) create mode 100644 src/app_modules/admin/vote/component/button/comp_button_detail_reject.tsx create mode 100644 src/app_modules/admin/vote/component/button/comp_button_detail_review.tsx rename src/app_modules/admin/vote/component/{detail.tsx => comp_detail.tsx} (100%) rename src/app_modules/admin/vote/component/{comp_publish.tsx => comp_detail_publish.tsx} (85%) create mode 100644 src/app_modules/admin/vote/component/comp_detail_reject.tsx create mode 100644 src/app_modules/admin/vote/component/comp_detail_review.tsx diff --git a/src/app_modules/admin/vote/child/table_reject/index.tsx b/src/app_modules/admin/vote/child/table_reject/index.tsx index 467d3802..bb55b4b9 100644 --- a/src/app_modules/admin/vote/child/table_reject/index.tsx +++ b/src/app_modules/admin/vote/child/table_reject/index.tsx @@ -5,15 +5,16 @@ import { AdminColor, } from "@/app_modules/_global/color/color_pallet"; import { ComponentAdminGlobal_TitlePage } from "@/app_modules/admin/_admin_global/_component"; +import Admin_DetailButton from "@/app_modules/admin/_admin_global/_component/button/detail_button"; import { ComponentAdminGlobal_NotifikasiBerhasil } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_berhasil"; import { ComponentAdminGlobal_NotifikasiGagal } from "@/app_modules/admin/_admin_global/admin_notifikasi/notifikasi_gagal"; import ComponentAdminGlobal_HeaderTamplate from "@/app_modules/admin/_admin_global/header_tamplate"; import ComponentAdminGlobal_IsEmptyData from "@/app_modules/admin/_admin_global/is_empty_data"; import CustomSkeleton from "@/app_modules/components/CustomSkeleton"; import { MODEL_VOTING } from "@/app_modules/vote/model/interface"; +import { RouterAdminVote } from "@/lib/router_admin/router_admin_vote"; import { clientLogger } from "@/util/clientLogger"; import { - Box, Button, Center, Group, @@ -21,15 +22,14 @@ import { Pagination, Paper, ScrollArea, - Spoiler, Stack, Table, Text, Textarea, - TextInput, + TextInput } from "@mantine/core"; import { useDisclosure, useShallowEffect } from "@mantine/hooks"; -import { IconBan, IconSearch } from "@tabler/icons-react"; +import { IconSearch } from "@tabler/icons-react"; import _ from "lodash"; import { useRouter } from "next/navigation"; import { useState } from "react"; @@ -127,7 +127,7 @@ function TableStatus() { return data?.map((e, i) => ( - + {/*
- - + */} + {/*
- + */} -
{e?.Author?.Profile?.name}
+
{e?.Author?.username}
{e.title}
- + {/*
- - + */} + {/* {e.Voting_DaftarNamaVote.map((v) => ( @@ -184,7 +184,7 @@ function TableStatus() { ))} - + */}
@@ -200,6 +200,12 @@ function TableStatus() { }).format(new Date(e?.akhirVote))}
+ + +
+ +
+ )); }; @@ -229,38 +235,25 @@ function TableStatus() { ) : ( - +
- - - - + + {renderTableBody()} diff --git a/src/app_modules/admin/vote/child/table_review/index.tsx b/src/app_modules/admin/vote/child/table_review/index.tsx index 7e4b694e..eb83a1c6 100644 --- a/src/app_modules/admin/vote/child/table_review/index.tsx +++ b/src/app_modules/admin/vote/child/table_review/index.tsx @@ -53,6 +53,8 @@ import { apiGetAdminVotingByStatus } from "../../lib/api_fetch_admin_voting"; import _ from "lodash"; import CustomSkeleton from "@/app_modules/components/CustomSkeleton"; import ComponentAdminGlobal_IsEmptyData from "@/app_modules/admin/_admin_global/is_empty_data"; +import Admin_DetailButton from "@/app_modules/admin/_admin_global/_component/button/detail_button"; +import { RouterAdminVote } from "@/lib/router_admin/router_admin_vote"; export default function AdminVote_TableReview() { return ( @@ -127,7 +129,7 @@ function TableStatus() { async function onPageClick(p: any) { setActivePage(p); } - + async function onLoadData() { handleLoadData(); setIsLoading(false); @@ -135,7 +137,6 @@ function TableStatus() { setIsAdminVoting_TriggerReview(false); } - async function onReject() { const data = { id: dataId, @@ -216,7 +217,7 @@ function TableStatus() { } handleLoadData(); ComponentGlobal_NotifikasiBerhasil(res.message); - closePublish() + closePublish(); } else { ComponentGlobal_NotifikasiGagal(res.message); } @@ -248,27 +249,6 @@ function TableStatus() { - - + + {/* + */} )); }; @@ -369,7 +355,6 @@ function TableStatus() { verticalSpacing={"md"} horizontalSpacing={"md"} p={"md"} - w={1500} > @@ -379,12 +364,6 @@ function TableStatus() { - - @@ -414,14 +393,14 @@ function TableStatus() { - +
-
Aksi
-
-
Catatan
-
Author
Judul
-
Deskripsi
-
-
Pilihan
-
Mulai Vote
Selesai Vote
+
Aksi
+
{e.title}
-
- - {e.deskripsi} - -
-
- - {e.Voting_DaftarNamaVote.map((v) => ( - - - {v.value} - - ))} - -
@@ -286,6 +266,12 @@ function TableStatus() {
+
+ +
+
Judul
-
Deskripsi
-
-
Pilihan
-
Mulai Vote