+
+ {JSON.stringify(isData, null, 1)}
+ {JSON.stringify(isDataMember, null, 1)}
+
+ {/* }
+ placeholder="Pencarian"
+ /> */}
+
+
+ Pilih Semua Anggota
+
+ {selectAll ? : ""}
+
+
+ {isData.map((v, i) => {
+ const isSelected = selectedFiles.some((i: any) => i?.idUser == v.idUser);
+ const found = isDataMember.some((i: any) => i.idUser == v.idUser)
+ return (
+ (!found) ? handleFileClick(i) : null}>
+
+
+
+
+
+ {v.name}
+
+ {(found) ? "sudah menjadi anggota" : ""}
+
+
+
+ {isSelected ? : ""}
+
+
+
+
+ );
+ })}
+
+
+
+
+
+
+ setOpenModal(false)}
+ description="Apakah Anda yakin ingin menambahkan anggota?"
+ onYes={(val) => {
+ if (val) {
+ onSubmit()
+ }
+ setOpenModal(false)
+ }} />
+
+ );
+}
diff --git a/src/module/project/ui/cancel_project.tsx b/src/module/project/ui/cancel_project.tsx
new file mode 100644
index 0000000..0b0f86a
--- /dev/null
+++ b/src/module/project/ui/cancel_project.tsx
@@ -0,0 +1,80 @@
+"use client"
+import { useParams, useRouter } from 'next/navigation';
+import React, { useState } from 'react';
+import toast from 'react-hot-toast';
+import { funCancelProject } from '../lib/api_project';
+import { Box, Button, Stack, Textarea } from '@mantine/core';
+import { LayoutNavbarNew, WARNA } from '@/module/_global';
+import LayoutModal from '@/module/_global/layout/layout_modal';
+
+export default function CancelProject() {
+ const router = useRouter()
+ const [alasan, setAlasan] = useState("")
+ const [openModal, setOpenModal] = useState(false)
+ const param = useParams<{ id: string }>()
+
+ function onVerification() {
+ if (alasan == "")
+ return toast.error("Error! harus memasukkan alasan pembatalan proyek")
+
+ setOpenModal(true)
+ }
+
+ async function onSubmit() {
+ try {
+ const res = await funCancelProject(param.id, { reason: alasan })
+ if (res.success) {
+ toast.success(res.message)
+ router.push("/project")
+ } else {
+ toast.error(res.message)
+ }
+ } catch (error) {
+ console.log(error)
+ toast.error("Gagal membatalkan proyek, coba lagi nanti")
+ }
+ }
+
+ return (
+