# style:
- UI Investasi - UI Donasi ## No issue
BIN
public/donasi/image/91771b2d-dbef-43ff-a346-0c1bde05dfdf.jpeg
Normal file
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 12 KiB |
BIN
public/donasi/invoice/022d0c53-d5c7-4b2c-a6a7-8dd1a9b7ac86.jpg
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
public/donasi/invoice/5e4c18e4-06da-4e91-a2fa-b19ba1ab5fa8.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
public/donasi/invoice/7293bb5a-df7e-4921-aae2-f525f3ebee3d.jpg
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
public/donasi/invoice/f25e58f5-6627-4e48-9a76-946f5e5db469.png
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
BIN
public/donasi/invoice/fc40104b-74e4-4ec6-a791-c7d33dee3446.jpg
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
public/donasi/kabar/0de92876-be7a-4d87-afcb-6ceba1586058.jpeg
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
public/file/41ddf88e-01a7-4653-8217-4c7b9c2031af.jpg
Normal file
|
After Width: | Height: | Size: 224 KiB |
BIN
public/file/7f26ce38-ed31-45f8-aea8-4ff3cfebff2d.jpg
Normal file
|
After Width: | Height: | Size: 125 KiB |
BIN
public/file/b97bd66d-835d-4b85-9364-b6e7f829086b.pdf
Normal file
BIN
public/file/c75b1df8-7c20-4183-bacd-23e83a9e8396.pdf
Normal file
BIN
public/file/dccc6d8f-d2d5-430f-84e5-69b401466ed3.jpeg
Normal file
|
After Width: | Height: | Size: 274 KiB |
BIN
public/investasi/206ab5ea-015e-414f-888d-052a83b5069d.jpg
Normal file
|
After Width: | Height: | Size: 125 KiB |
BIN
public/investasi/b5dee9fb-ea68-4115-9a0a-068c26247ed7.jpg
Normal file
|
After Width: | Height: | Size: 224 KiB |
BIN
public/investasi/b988c656-c8b7-4065-a5a5-6813cbc9d077.jpeg
Normal file
|
After Width: | Height: | Size: 274 KiB |
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -8,7 +8,7 @@ export default async function Page({ params }: { params: { id: string } }) {
|
|||||||
const countDonatur= await Donasi_getCountDonatur(params.id)
|
const countDonatur= await Donasi_getCountDonatur(params.id)
|
||||||
const userLoginId = await user_getOneUserId();
|
const userLoginId = await user_getOneUserId();
|
||||||
|
|
||||||
console.log(userLoginId)
|
// console.log(userLoginId)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage />
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,16 +1,18 @@
|
|||||||
import { Donasi_ProsesTransaksi } from "@/app_modules/donasi";
|
import { Donasi_ProsesTransaksi } from "@/app_modules/donasi";
|
||||||
import { Donasi_getOneInvoiceById } from "@/app_modules/donasi/fun/get/get_one_invoice_by_id";
|
import { Donasi_getOneInvoiceById } from "@/app_modules/donasi/fun/get/get_one_invoice_by_id";
|
||||||
|
import { donasi_getOneStatusInvoiceById } from "@/app_modules/donasi/fun/get/get_one_status_invoice_by_id";
|
||||||
import donasi_getMasterNomorAdmin from "@/app_modules/donasi/fun/master/get_nomor_admin";
|
import donasi_getMasterNomorAdmin from "@/app_modules/donasi/fun/master/get_nomor_admin";
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
// console.log(params.id)
|
let invoiceId = params.id;
|
||||||
const dataInvoice = await Donasi_getOneInvoiceById(params.id);
|
|
||||||
const nomorAdmin = await donasi_getMasterNomorAdmin();
|
const nomorAdmin = await donasi_getMasterNomorAdmin();
|
||||||
|
const statusInvoice = await donasi_getOneStatusInvoiceById({invoiceId: invoiceId})
|
||||||
|
// console.log(statusInvoice)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Donasi_ProsesTransaksi
|
<Donasi_ProsesTransaksi
|
||||||
dataInvoice={dataInvoice as any}
|
statusInvoice={statusInvoice as any}
|
||||||
nomorAdmin={nomorAdmin}
|
nomorAdmin={nomorAdmin}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -24,7 +24,6 @@ export default async function Page() {
|
|||||||
const pembagianDeviden = await getPembagianDeviden();
|
const pembagianDeviden = await getPembagianDeviden();
|
||||||
const statusInvestasi = await getStatusInvestasi();
|
const statusInvestasi = await getStatusInvestasi();
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<InvestasiCreate
|
<InvestasiCreate
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
import ComponentGlobal_V2_LoadingPage from "@/app_modules/_global/loading_page_v2";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<ComponentGlobal_V2_LoadingPage/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -35,6 +35,8 @@ import { AdminDonasi_funUpdateStatusReject } from "../fun/update/fun_status_reje
|
|||||||
import ComponentAdminGlobal_BackButton from "../../component_global/back_button";
|
import ComponentAdminGlobal_BackButton from "../../component_global/back_button";
|
||||||
import ComponentAdminDonasi_TampilanDetailDonasi from "../component/tampilan_detail_donasi";
|
import ComponentAdminDonasi_TampilanDetailDonasi from "../component/tampilan_detail_donasi";
|
||||||
import ComponentAdminDonasi_CeritaPenggalangDana from "../component/tampilan_detail_cerita";
|
import ComponentAdminDonasi_CeritaPenggalangDana from "../component/tampilan_detail_cerita";
|
||||||
|
import mqtt_client from "@/util/mqtt_client";
|
||||||
|
import adminNotifikasi_funCreateToUser from "../../notifikasi/fun/create/fun_create_notif_user";
|
||||||
|
|
||||||
export default function AdminDonasi_DetailReview({
|
export default function AdminDonasi_DetailReview({
|
||||||
dataReview,
|
dataReview,
|
||||||
@@ -80,22 +82,36 @@ function ButtonOnHeader({
|
|||||||
const [catatan, setCatatan] = useState("");
|
const [catatan, setCatatan] = useState("");
|
||||||
|
|
||||||
async function onPulish() {
|
async function onPulish() {
|
||||||
await AdminDonasi_funUpdateStatusPublish(donasi.id, "1").then(
|
const res = await AdminDonasi_funUpdateStatusPublish(donasi.id, "1");
|
||||||
async (res) => {
|
if (res.status === 200) {
|
||||||
if (res.status === 200) {
|
const dataNotif = {
|
||||||
const newData = await AdminDonasi_getOneById(donasi?.id);
|
appId: res.data?.id,
|
||||||
setData(newData);
|
status: res.data?.DonasiMaster_Status?.name as any,
|
||||||
ComponentAdminGlobal_NotifikasiBerhasil(
|
userId: res.data?.authorId as any,
|
||||||
"Berhasil Mengubah Status Donasi"
|
pesan: res.data?.title as any,
|
||||||
);
|
kategoriApp: "DONASI",
|
||||||
setLoadingPublish(true);
|
title: "Donasi publish",
|
||||||
} else {
|
};
|
||||||
ComponentAdminGlobal_NotifikasiPeringatan(
|
|
||||||
"Gagal Mengubah Status Donasi"
|
const notif = await adminNotifikasi_funCreateToUser({
|
||||||
);
|
data: dataNotif as any,
|
||||||
}
|
});
|
||||||
|
|
||||||
|
if (notif.status === 201) {
|
||||||
|
mqtt_client.publish(
|
||||||
|
"USER",
|
||||||
|
JSON.stringify({ userId: res?.data?.authorId, count: 1 })
|
||||||
|
);
|
||||||
|
const newData = await AdminDonasi_getOneById(donasi?.id);
|
||||||
|
setData(newData);
|
||||||
|
ComponentAdminGlobal_NotifikasiBerhasil(
|
||||||
|
"Berhasil Mengubah Status Donasi"
|
||||||
|
);
|
||||||
|
setLoadingPublish(true);
|
||||||
}
|
}
|
||||||
);
|
} else {
|
||||||
|
ComponentAdminGlobal_NotifikasiPeringatan("Gagal Mengubah Status Donasi");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onReject() {
|
async function onReject() {
|
||||||
@@ -104,19 +120,40 @@ function ButtonOnHeader({
|
|||||||
"Lengkapi Alasan Penolakan"
|
"Lengkapi Alasan Penolakan"
|
||||||
);
|
);
|
||||||
|
|
||||||
await AdminDonasi_funUpdateStatusReject(donasi.id, "4", catatan).then(
|
const res = await AdminDonasi_funUpdateStatusReject(
|
||||||
async (res) => {
|
donasi.id,
|
||||||
if (res.status === 200) {
|
"4",
|
||||||
const newData = await AdminDonasi_getOneById(donasi?.id);
|
catatan
|
||||||
setData(newData);
|
|
||||||
close();
|
|
||||||
ComponentAdminGlobal_NotifikasiBerhasil(res.message);
|
|
||||||
setLoadingReject(true);
|
|
||||||
} else {
|
|
||||||
ComponentAdminGlobal_NotifikasiGagal(res.message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
|
if (res.status === 200) {
|
||||||
|
const dataNotif = {
|
||||||
|
appId: res.data?.id,
|
||||||
|
status: res.data?.DonasiMaster_Status?.name as any,
|
||||||
|
userId: res.data?.authorId as any,
|
||||||
|
pesan: res.data?.title as any,
|
||||||
|
kategoriApp: "DONASI",
|
||||||
|
title: "Donasi anda di tolak !",
|
||||||
|
};
|
||||||
|
|
||||||
|
const notif = await adminNotifikasi_funCreateToUser({
|
||||||
|
data: dataNotif as any,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (notif.status === 201) {
|
||||||
|
mqtt_client.publish(
|
||||||
|
"USER",
|
||||||
|
JSON.stringify({ userId: res?.data?.authorId, count: 1 })
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const newData = await AdminDonasi_getOneById(donasi?.id);
|
||||||
|
setData(newData);
|
||||||
|
close();
|
||||||
|
ComponentAdminGlobal_NotifikasiBerhasil(res.message);
|
||||||
|
setLoadingReject(true);
|
||||||
|
} else {
|
||||||
|
ComponentAdminGlobal_NotifikasiGagal(res.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -190,5 +227,3 @@ function ButtonOnHeader({
|
|||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,8 @@ import { RouterAdminDonasi } from "@/app/lib/router_admin/router_admin_donasi";
|
|||||||
import adminDonasi_funUpdateStatusDanTotal from "../../fun/update/fun_update_status_dan_total";
|
import adminDonasi_funUpdateStatusDanTotal from "../../fun/update/fun_update_status_dan_total";
|
||||||
import { ComponentAdminGlobal_NotifikasiBerhasil } from "@/app_modules/admin/component_global/admin_notifikasi/notifikasi_berhasil";
|
import { ComponentAdminGlobal_NotifikasiBerhasil } from "@/app_modules/admin/component_global/admin_notifikasi/notifikasi_berhasil";
|
||||||
import { ComponentAdminGlobal_NotifikasiGagal } from "@/app_modules/admin/component_global/admin_notifikasi/notifikasi_gagal";
|
import { ComponentAdminGlobal_NotifikasiGagal } from "@/app_modules/admin/component_global/admin_notifikasi/notifikasi_gagal";
|
||||||
|
import mqtt_client from "@/util/mqtt_client";
|
||||||
|
import adminNotifikasi_funCreateToUser from "@/app_modules/admin/notifikasi/fun/create/fun_create_notif_user";
|
||||||
|
|
||||||
export default function AdminDonasi_DetailPublish({
|
export default function AdminDonasi_DetailPublish({
|
||||||
dataPublish,
|
dataPublish,
|
||||||
@@ -266,7 +268,6 @@ function TampilanListDonatur({
|
|||||||
donatur: any;
|
donatur: any;
|
||||||
listMasterStatus: MODEL_NEW_DEFAULT_MASTER[];
|
listMasterStatus: MODEL_NEW_DEFAULT_MASTER[];
|
||||||
dataDonasi: MODEL_DONASI;
|
dataDonasi: MODEL_DONASI;
|
||||||
|
|
||||||
onSuccessDonasi: (val: any) => void;
|
onSuccessDonasi: (val: any) => void;
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -509,6 +510,57 @@ function ButtonAccept({
|
|||||||
target: target,
|
target: target,
|
||||||
});
|
});
|
||||||
if (updateStatus.status == 200) {
|
if (updateStatus.status == 200) {
|
||||||
|
const dataNotif = {
|
||||||
|
appId: updateStatus.data?.id,
|
||||||
|
userId: updateStatus.data?.authorId,
|
||||||
|
pesan: updateStatus.data?.Donasi?.title,
|
||||||
|
status: updateStatus.data?.DonasiMaster_StatusInvoice?.name,
|
||||||
|
kategoriApp: "DONASI",
|
||||||
|
title: "Terimakasih, Donasi anda telah diterima",
|
||||||
|
};
|
||||||
|
|
||||||
|
const notif = await adminNotifikasi_funCreateToUser({
|
||||||
|
data: dataNotif as any,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (notif.status === 201) {
|
||||||
|
mqtt_client.publish(
|
||||||
|
"USER",
|
||||||
|
JSON.stringify({ userId: updateStatus?.data?.authorId, count: 1 })
|
||||||
|
);
|
||||||
|
|
||||||
|
mqtt_client.publish(
|
||||||
|
"donasi_invoice",
|
||||||
|
JSON.stringify({
|
||||||
|
invoiceId: invoiceId,
|
||||||
|
statusInvoiceId: "1",
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const dataNotifToAuthorDonasi = {
|
||||||
|
appId: updateStatus.data?.Donasi?.id,
|
||||||
|
userId: updateStatus.data?.Donasi?.authorId,
|
||||||
|
pesan: updateStatus.data?.Donasi?.title,
|
||||||
|
status: "Donatur Baru",
|
||||||
|
kategoriApp: "DONASI",
|
||||||
|
title: "Ada donatur baru",
|
||||||
|
};
|
||||||
|
|
||||||
|
const notifToAuthorDonasi = await adminNotifikasi_funCreateToUser({
|
||||||
|
data: dataNotifToAuthorDonasi as any,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (notifToAuthorDonasi.status === 201) {
|
||||||
|
mqtt_client.publish(
|
||||||
|
"USER",
|
||||||
|
JSON.stringify({
|
||||||
|
userId: updateStatus?.data?.Donasi?.authorId,
|
||||||
|
count: 1,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const updateData = await AdminDonasi_getOneById(donasiId);
|
const updateData = await AdminDonasi_getOneById(donasiId);
|
||||||
onSuccessDonasi(updateData as any);
|
onSuccessDonasi(updateData as any);
|
||||||
const updatelistDonatur = await adminDonasi_getListDonatur({
|
const updatelistDonatur = await adminDonasi_getListDonatur({
|
||||||
@@ -516,7 +568,6 @@ function ButtonAccept({
|
|||||||
page: 1,
|
page: 1,
|
||||||
});
|
});
|
||||||
onSuccessDonatur(updatelistDonatur);
|
onSuccessDonatur(updatelistDonatur);
|
||||||
|
|
||||||
ComponentAdminGlobal_NotifikasiBerhasil(updateStatus.message);
|
ComponentAdminGlobal_NotifikasiBerhasil(updateStatus.message);
|
||||||
} else {
|
} else {
|
||||||
ComponentAdminGlobal_NotifikasiGagal(updateStatus.message);
|
ComponentAdminGlobal_NotifikasiGagal(updateStatus.message);
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ import prisma from "@/app/lib/prisma";
|
|||||||
export async function AdminDonasi_funCountDonatur(donasiId: string) {
|
export async function AdminDonasi_funCountDonatur(donasiId: string) {
|
||||||
const donatur = await prisma.donasi_Invoice.count({
|
const donatur = await prisma.donasi_Invoice.count({
|
||||||
where: {
|
where: {
|
||||||
donasiId: donasiId
|
donasiId: donasiId,
|
||||||
|
donasiMaster_StatusInvoiceId: "1"
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export default async function adminDonasi_getListReview({
|
|||||||
skip: skipData,
|
skip: skipData,
|
||||||
take: takeData,
|
take: takeData,
|
||||||
orderBy: {
|
orderBy: {
|
||||||
createdAt: "desc",
|
updatedAt: "desc",
|
||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
donasiMaster_StatusDonasiId: "2",
|
donasiMaster_StatusDonasiId: "2",
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ export async function AdminDonasi_getOneById(id: string) {
|
|||||||
DonasiMaster_Ketegori: true,
|
DonasiMaster_Ketegori: true,
|
||||||
DonasiMaster_Durasi: true,
|
DonasiMaster_Durasi: true,
|
||||||
DonasiMaster_Status: true,
|
DonasiMaster_Status: true,
|
||||||
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
"use server";
|
"use server";
|
||||||
|
|
||||||
import prisma from "@/app/lib/prisma";
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import { RouterAdminDonasi } from "@/app/lib/router_admin/router_admin_donasi";
|
||||||
import { RouterAdminDonasi_OLD } from "@/app/lib/router_hipmi/router_admin";
|
import { RouterAdminDonasi_OLD } from "@/app/lib/router_hipmi/router_admin";
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
import { revalidatePath } from "next/cache";
|
import { revalidatePath } from "next/cache";
|
||||||
@@ -19,11 +20,22 @@ export async function AdminDonasi_funUpdateStatusPublish(
|
|||||||
donasiMaster_StatusDonasiId: statusId,
|
donasiMaster_StatusDonasiId: statusId,
|
||||||
publishTime: new Date(publishTime),
|
publishTime: new Date(publishTime),
|
||||||
},
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
title: true,
|
||||||
|
authorId: true,
|
||||||
|
DonasiMaster_Status: {
|
||||||
|
select: {
|
||||||
|
name: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!data) return { status: 400, message: "Data tidak ditemukan" };
|
if (!data) return { status: 400, message: "Data tidak ditemukan" };
|
||||||
revalidatePath("/dev/admin/donasi/table/review");
|
revalidatePath(RouterAdminDonasi.table_review);
|
||||||
return {
|
return {
|
||||||
|
data: data,
|
||||||
status: 200,
|
status: 200,
|
||||||
message: "Status berhasil diganti",
|
message: "Status berhasil diganti",
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -19,11 +19,22 @@ export async function AdminDonasi_funUpdateStatusReject(
|
|||||||
donasiMaster_StatusDonasiId: statusId,
|
donasiMaster_StatusDonasiId: statusId,
|
||||||
catatan: catatan,
|
catatan: catatan,
|
||||||
},
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
title: true,
|
||||||
|
authorId: true,
|
||||||
|
DonasiMaster_Status: {
|
||||||
|
select: {
|
||||||
|
name: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!data) return { status: 400, message: "Data tidak ditemukan" };
|
if (!data) return { status: 400, message: "Data tidak ditemukan" };
|
||||||
revalidatePath(RouterAdminDonasi.table_review);
|
revalidatePath(RouterAdminDonasi.table_review);
|
||||||
return {
|
return {
|
||||||
|
data: data,
|
||||||
status: 200,
|
status: 200,
|
||||||
message: "Status berhasil diganti",
|
message: "Status berhasil diganti",
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -30,6 +30,23 @@ export default async function adminDonasi_funUpdateStatusDanTotal({
|
|||||||
data: {
|
data: {
|
||||||
donasiMaster_StatusInvoiceId: statusInvoiceId,
|
donasiMaster_StatusInvoiceId: statusInvoiceId,
|
||||||
},
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
authorId: true,
|
||||||
|
Donasi: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
title: true,
|
||||||
|
authorId: true,
|
||||||
|
|
||||||
|
},
|
||||||
|
},
|
||||||
|
DonasiMaster_StatusInvoice: {
|
||||||
|
select: {
|
||||||
|
name: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
if (!updateInvoice) return { status: 400, message: "Update invoice gagal" };
|
if (!updateInvoice) return { status: 400, message: "Update invoice gagal" };
|
||||||
|
|
||||||
@@ -45,5 +62,5 @@ export default async function adminDonasi_funUpdateStatusDanTotal({
|
|||||||
|
|
||||||
if (!updateDonasi) return { status: 400, message: "Update donasi gagal" };
|
if (!updateDonasi) return { status: 400, message: "Update donasi gagal" };
|
||||||
revalidatePath(RouterAdminDonasi_OLD.detail_publish + donasiId);
|
revalidatePath(RouterAdminDonasi_OLD.detail_publish + donasiId);
|
||||||
return { status: 200, message: "Update Berhasil" };
|
return { data: updateInvoice, status: 200, message: "Update Berhasil" };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ async function onReject(
|
|||||||
catatan: catatan,
|
catatan: catatan,
|
||||||
};
|
};
|
||||||
|
|
||||||
const res = await AdminEvent_funEditCatatanById(body as any, "4");
|
const res = await AdminEvent_funEditCatatanById(body as any, "4");
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
const dataNotif = {
|
const dataNotif = {
|
||||||
appId: res.data?.id,
|
appId: res.data?.id,
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ import adminNotifikasi_findRouterJob from "./notifikasi/route_setting/job";
|
|||||||
import adminNotifikasi_findRouterForum from "./notifikasi/route_setting/forum";
|
import adminNotifikasi_findRouterForum from "./notifikasi/route_setting/forum";
|
||||||
import { adminNotifikasi_findRouterVoting } from "./notifikasi/route_setting/voting";
|
import { adminNotifikasi_findRouterVoting } from "./notifikasi/route_setting/voting";
|
||||||
import { adminNotifikasi_findRouterEvent } from "./notifikasi/route_setting/event";
|
import { adminNotifikasi_findRouterEvent } from "./notifikasi/route_setting/event";
|
||||||
|
import adminNotifikasi_findRouterDonasi from "./notifikasi/route_setting/donasi";
|
||||||
|
|
||||||
export default function AdminLayout({
|
export default function AdminLayout({
|
||||||
children,
|
children,
|
||||||
@@ -441,6 +442,17 @@ function DrawerNotifikasi({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
e.kategoriApp === "DONASI" && adminNotifikasi_findRouterDonasi({
|
||||||
|
data: e,
|
||||||
|
router: router,
|
||||||
|
onChangeNavbar(val) {
|
||||||
|
onChangeNavbar(val);
|
||||||
|
},
|
||||||
|
onToggleNavbar(val) {
|
||||||
|
onToggleNavbar(val);
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
const updateIsRead = await adminNotifikasi_funUpdateIsReadById({
|
const updateIsRead = await adminNotifikasi_funUpdateIsReadById({
|
||||||
notifId: e?.id,
|
notifId: e?.id,
|
||||||
});
|
});
|
||||||
|
|||||||
50
src/app_modules/admin/notifikasi/route_setting/donasi.ts
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
import { RouterAdminDonasi } from "@/app/lib/router_admin/router_admin_donasi";
|
||||||
|
import { RouterAdminDonasi_OLD } from "@/app/lib/router_hipmi/router_admin";
|
||||||
|
import { MODEL_NOTIFIKASI } from "@/app_modules/notifikasi/model/interface";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { AppRouterInstance } from "next/dist/shared/lib/app-router-context.shared-runtime";
|
||||||
|
|
||||||
|
export default async function adminNotifikasi_findRouterDonasi({
|
||||||
|
data,
|
||||||
|
router,
|
||||||
|
onChangeNavbar,
|
||||||
|
onToggleNavbar,
|
||||||
|
}: {
|
||||||
|
data: MODEL_NOTIFIKASI;
|
||||||
|
router: AppRouterInstance;
|
||||||
|
onChangeNavbar: (val: any) => void;
|
||||||
|
onToggleNavbar: (val: any) => void;
|
||||||
|
}) {
|
||||||
|
if (data.status === "Review") {
|
||||||
|
const path = RouterAdminDonasi.table_review;
|
||||||
|
router.push(path);
|
||||||
|
onChangeNavbar({
|
||||||
|
id: 3,
|
||||||
|
childId: 33,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
data.status === "Menunggu" ||
|
||||||
|
data.status === "Berhasil" ||
|
||||||
|
data.status === "Proses" ||
|
||||||
|
data.status === "Gagal"
|
||||||
|
) {
|
||||||
|
const path = RouterAdminDonasi_OLD.detail_publish + data.appId;
|
||||||
|
router.push(path, { scroll: false });
|
||||||
|
onChangeNavbar({
|
||||||
|
id: 3,
|
||||||
|
childId: 32,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (data.status === "Draft") {
|
||||||
|
// router.push(routeName + "review");
|
||||||
|
// onChangeNavbar({
|
||||||
|
// id: 6,
|
||||||
|
// childId: 63,
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
onToggleNavbar(true);
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@ export async function auth_funValidasi(nomor: string) {
|
|||||||
id: true,
|
id: true,
|
||||||
nomor: true,
|
nomor: true,
|
||||||
username: true,
|
username: true,
|
||||||
masterUserRoleId: true
|
masterUserRoleId: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -37,13 +37,15 @@ export async function auth_funValidasi(nomor: string) {
|
|||||||
cookies().set({
|
cookies().set({
|
||||||
name: "ssn",
|
name: "ssn",
|
||||||
value: res,
|
value: res,
|
||||||
maxAge: 60 * 60 * 24 * 7,
|
maxAge: 60 * 60 * 24 * 30,
|
||||||
});
|
});
|
||||||
|
|
||||||
revalidatePath(RouterHome.main_home);
|
revalidatePath(RouterHome.main_home);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
status: 200,
|
||||||
return { status: 200, message: "Nomor Terverifikasi", role: cek.masterUserRoleId };
|
message: "Nomor Terverifikasi",
|
||||||
|
role: cek.masterUserRoleId,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,13 +63,13 @@ export default function MainCrowd() {
|
|||||||
color: "white",
|
color: "white",
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setLoadingInv(true);
|
// setLoadingInv(true);
|
||||||
router.push(RouterCrowd.investasi);
|
// router.push(RouterCrowd.investasi);
|
||||||
setChangeColor(0);
|
// setChangeColor(0);
|
||||||
// ComponentGlobal_NotifikasiPeringatan(
|
ComponentGlobal_NotifikasiPeringatan(
|
||||||
// "Sementara ini sedang maintenance",
|
"Sementara ini sedang maintenance",
|
||||||
// 3000
|
3000
|
||||||
// );
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Grid>
|
<Grid>
|
||||||
@@ -103,13 +103,13 @@ export default function MainCrowd() {
|
|||||||
color: "white",
|
color: "white",
|
||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setLoadingDon(true);
|
// setLoadingDon(true);
|
||||||
router.push(RouterCrowd.donasi);
|
// router.push(RouterCrowd.donasi);
|
||||||
setDonasiHotMenu(0);
|
// setDonasiHotMenu(0);
|
||||||
// ComponentGlobal_NotifikasiPeringatan(
|
ComponentGlobal_NotifikasiPeringatan(
|
||||||
// "Sementara ini sedang maintenance",
|
"Sementara ini sedang maintenance",
|
||||||
// 3000
|
3000
|
||||||
// );
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Grid>
|
<Grid>
|
||||||
|
|||||||
@@ -35,11 +35,9 @@ export default function ComponentDonasi_DetailDataGalangDana({
|
|||||||
>
|
>
|
||||||
<Stack>
|
<Stack>
|
||||||
<AspectRatio
|
<AspectRatio
|
||||||
ratio={9 / 16}
|
ratio={1 / 1}
|
||||||
mx={"sm"}
|
mx={"sm"}
|
||||||
mah={300}
|
mah={300}
|
||||||
// bg={"blue"}
|
|
||||||
style={{}}
|
|
||||||
>
|
>
|
||||||
<Image
|
<Image
|
||||||
alt="Foto"
|
alt="Foto"
|
||||||
|
|||||||
@@ -42,14 +42,14 @@ export default function ComponentDonasi_CeritaPenggalangMain({
|
|||||||
<Group position="apart">
|
<Group position="apart">
|
||||||
<Text>
|
<Text>
|
||||||
{new Intl.DateTimeFormat("id-ID", { dateStyle: "full" }).format(
|
{new Intl.DateTimeFormat("id-ID", { dateStyle: "full" }).format(
|
||||||
donasi.createdAt
|
donasi?.createdAt
|
||||||
)}
|
)}
|
||||||
</Text>
|
</Text>
|
||||||
<ActionIcon
|
<ActionIcon
|
||||||
variant="transparent"
|
variant="transparent"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
router.push(RouterDonasi.cerita_penggalang + `${donasi.id}`);
|
router.push(RouterDonasi.cerita_penggalang + `${donasi?.id}`);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{isLoading ? (
|
{isLoading ? (
|
||||||
@@ -63,7 +63,7 @@ export default function ComponentDonasi_CeritaPenggalangMain({
|
|||||||
)}
|
)}
|
||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
</Group>
|
</Group>
|
||||||
<Text lineClamp={4}>{donasi.CeritaDonasi.cerita}</Text>
|
<Text lineClamp={4}>{donasi?.CeritaDonasi.cerita}</Text>
|
||||||
{/* <Text c={"blue"}>Baca selengkapnya</Text> */}
|
{/* <Text c={"blue"}>Baca selengkapnya</Text> */}
|
||||||
</Stack>
|
</Stack>
|
||||||
</Paper>
|
</Paper>
|
||||||
|
|||||||
@@ -62,23 +62,30 @@ export function ComponentDonasi_DetailDataMain({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Center>
|
<AspectRatio ratio={1 / 1} mx={"sm"} mah={300}>
|
||||||
|
<Image
|
||||||
|
alt="Foto"
|
||||||
|
src={RouterDonasi.api_image + `${donasi?.imageDonasi?.url}`}
|
||||||
|
radius={"sm"}
|
||||||
|
/>
|
||||||
|
</AspectRatio>
|
||||||
|
{/* <Center>
|
||||||
<Image
|
<Image
|
||||||
maw={200}
|
maw={200}
|
||||||
radius={"xs"}
|
radius={"xs"}
|
||||||
alt="Foto"
|
alt="Foto"
|
||||||
src={RouterDonasi.api_gambar + `${donasi.imagesId}`}
|
src={RouterDonasi?.api_gambar + `${donasi?.imagesId}`}
|
||||||
/>
|
/>
|
||||||
</Center>
|
</Center> */}
|
||||||
{/* <AspectRatio ratio={16 / 9}>
|
{/* <AspectRatio ratio={16 / 9}>
|
||||||
<Paper radius={"md"}>
|
<Paper radius={"md"}>
|
||||||
</Paper>
|
</Paper>
|
||||||
</AspectRatio> */}
|
</AspectRatio> */}
|
||||||
<Stack spacing={0} mt={"lg"}>
|
<Stack spacing={0} mt={"lg"}>
|
||||||
<Title order={4}>{donasi.title}</Title>
|
<Title order={4}>{donasi?.title}</Title>
|
||||||
<ComponentDonasi_TampilanHitungMundur
|
<ComponentDonasi_TampilanHitungMundur
|
||||||
durasi={donasi.DonasiMaster_Durasi.name}
|
durasi={donasi?.DonasiMaster_Durasi.name}
|
||||||
publishTime={donasi.publishTime}
|
publishTime={donasi?.publishTime}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack spacing={0}>
|
<Stack spacing={0}>
|
||||||
@@ -86,12 +93,12 @@ export function ComponentDonasi_DetailDataMain({
|
|||||||
<Stack spacing={0}>
|
<Stack spacing={0}>
|
||||||
<Text fz={12}>Dana terkumpul</Text>
|
<Text fz={12}>Dana terkumpul</Text>
|
||||||
<Title order={4} c="blue">
|
<Title order={4} c="blue">
|
||||||
<TampilanRupiahDonasi nominal={+donasi.terkumpul} />
|
<TampilanRupiahDonasi nominal={+donasi?.terkumpul} />
|
||||||
</Title>
|
</Title>
|
||||||
<Group>
|
<Group>
|
||||||
<Text fz={10}>Dari total</Text>{" "}
|
<Text fz={10}>Dari total</Text>{" "}
|
||||||
<TampilanRupiahDonasi
|
<TampilanRupiahDonasi
|
||||||
nominal={+donasi.target}
|
nominal={+donasi?.target}
|
||||||
fontSize={10}
|
fontSize={10}
|
||||||
/>
|
/>
|
||||||
</Group>
|
</Group>
|
||||||
@@ -104,12 +111,12 @@ export function ComponentDonasi_DetailDataMain({
|
|||||||
color: MainColor.yellow,
|
color: MainColor.yellow,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{donasi.DonasiMaster_Ketegori.name}
|
{donasi?.DonasiMaster_Ketegori.name}
|
||||||
</Title>
|
</Title>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Group>
|
</Group>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Progress value={+donasi.progres} animate />
|
<Progress value={+donasi?.progres} color="yellow" size={"lg"} />
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.Col
|
<Grid.Col
|
||||||
@@ -145,7 +152,7 @@ export function ComponentDonasi_DetailDataMain({
|
|||||||
span={"auto"}
|
span={"auto"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setLoadingKabar(true);
|
setLoadingKabar(true);
|
||||||
router.push(RouterDonasi.kabar + `${donasi.id}`);
|
router.push(RouterDonasi.kabar + `${donasi?.id}`);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Stack spacing={"sm"} align="center">
|
<Stack spacing={"sm"} align="center">
|
||||||
|
|||||||
@@ -73,14 +73,15 @@ export default function ComponentDonasi_InformasiPenggalangMain({
|
|||||||
<Group>
|
<Group>
|
||||||
<Avatar radius={"xl"} variant="filled" bg={"blue"}>
|
<Avatar radius={"xl"} variant="filled" bg={"blue"}>
|
||||||
{(() => {
|
{(() => {
|
||||||
const usr = author.username;
|
// return null
|
||||||
const splt = usr.split("");
|
const usr = author?.username;
|
||||||
|
const splt = usr?.split("");
|
||||||
const Up = _.upperCase(splt[0]);
|
const Up = _.upperCase(splt[0]);
|
||||||
|
|
||||||
return Up;
|
return Up;
|
||||||
})()}
|
})()}
|
||||||
</Avatar>
|
</Avatar>
|
||||||
<Text>{author.username}</Text>
|
<Text>{author?.username}</Text>
|
||||||
</Group>
|
</Group>
|
||||||
<ComponentGlobal_BoxInformation
|
<ComponentGlobal_BoxInformation
|
||||||
informasi="Semua dana yang terkumpul akan disalurkan ke penggalang dana,
|
informasi="Semua dana yang terkumpul akan disalurkan ke penggalang dana,
|
||||||
|
|||||||
@@ -6,35 +6,34 @@ import moment from "moment";
|
|||||||
|
|
||||||
import { MODEL_DONASI_KABAR } from "../../model/interface";
|
import { MODEL_DONASI_KABAR } from "../../model/interface";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
|
||||||
export default function ComponentDonasi_ListKabar({
|
export default function ComponentDonasi_ListKabar({
|
||||||
kabar,
|
kabar,
|
||||||
route
|
route,
|
||||||
}: {
|
}: {
|
||||||
kabar: MODEL_DONASI_KABAR;
|
kabar: MODEL_DONASI_KABAR;
|
||||||
route: string
|
route: string;
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Paper bg={"gray.1"} p={"md"}>
|
<Paper
|
||||||
|
style={{
|
||||||
|
backgroundColor: AccentColor.blue,
|
||||||
|
border: `2px solid ${AccentColor.darkblue}`,
|
||||||
|
padding: "15px",
|
||||||
|
cursor: "pointer",
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
marginBottom: "5px",
|
||||||
|
}}
|
||||||
|
onClick={() => router.push(route + `${kabar.id}`)}
|
||||||
|
>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Text fz={"xs"}>{moment(kabar.createdAt).format("ll")}</Text>
|
<Text fz={"xs"}>{moment(kabar.createdAt).format("ll")}</Text>
|
||||||
|
|
||||||
<Stack>
|
<Title order={5}>{kabar.title}</Title>
|
||||||
<Title order={5}>{kabar.title}</Title>
|
|
||||||
<Stack spacing={0}>
|
|
||||||
<Text lineClamp={2}>{kabar.deskripsi}</Text>
|
|
||||||
<Text
|
|
||||||
c={"blue"}
|
|
||||||
onClick={() =>
|
|
||||||
router.push(route + `${kabar.id}`)
|
|
||||||
}
|
|
||||||
>
|
|
||||||
Buka Kabar
|
|
||||||
</Text>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Paper>
|
</Paper>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -3,18 +3,15 @@
|
|||||||
import { Footer, Center, Button } from "@mantine/core";
|
import { Footer, Center, Button } from "@mantine/core";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
|
|
||||||
export default function FooterDonasi() {
|
export default function FooterDonasi() {
|
||||||
const router = useRouter()
|
const router = useRouter();
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Footer height={70} px={"md"}>
|
<Center h={"100%"}>
|
||||||
<Center h={"100%"}>
|
<Button w={"80%"} radius={"xl"} onClick={() => router.back()}>
|
||||||
<Button w={"100%"} radius={"xl"} onClick={() => router.back()}>
|
Tutup
|
||||||
Tutup
|
</Button>
|
||||||
</Button>
|
</Center>
|
||||||
</Center>
|
|
||||||
</Footer>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
|
import {
|
||||||
|
AccentColor,
|
||||||
|
MainColor,
|
||||||
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
|
||||||
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
|
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
|
||||||
import {
|
import {
|
||||||
ComponentGlobal_WarningMaxUpload,
|
ComponentGlobal_WarningMaxUpload,
|
||||||
maksimalUploadFile,
|
maksimalUploadFile,
|
||||||
} from "@/app_modules/_global/component/waring_popup";
|
} from "@/app_modules/_global/component/waring_popup";
|
||||||
|
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||||
import {
|
import {
|
||||||
AspectRatio,
|
AspectRatio,
|
||||||
Button,
|
Button,
|
||||||
@@ -23,17 +29,13 @@ import { useAtom } from "jotai";
|
|||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import toast from "react-simple-toasts";
|
|
||||||
import ComponentDonasi_NotedBox from "../component/noted_box";
|
|
||||||
import { NotifPeringatan } from "../component/notifikasi/notif_peringatan";
|
import { NotifPeringatan } from "../component/notifikasi/notif_peringatan";
|
||||||
import { Donasi_funCreate } from "../fun/create/fun_create_donasi";
|
import { Donasi_funCreate } from "../fun/create/fun_create_donasi";
|
||||||
import { gs_donasi_hot_menu, gs_donasi_tabs_posting } from "../global_state";
|
import { gs_donasi_hot_menu, gs_donasi_tabs_posting } from "../global_state";
|
||||||
import { MODEL_DONASI_TEMPORARY } from "../model/interface";
|
import { MODEL_DONASI_TEMPORARY } from "../model/interface";
|
||||||
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
import {
|
import mqtt_client from "@/util/mqtt_client";
|
||||||
AccentColor,
|
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
|
||||||
MainColor,
|
|
||||||
} from "@/app_modules/_global/color/color_pallet";
|
|
||||||
export default function CreateCeritaPenggalangDonasi({
|
export default function CreateCeritaPenggalangDonasi({
|
||||||
dataTemporary,
|
dataTemporary,
|
||||||
userId,
|
userId,
|
||||||
@@ -82,16 +84,37 @@ export default function CreateCeritaPenggalangDonasi({
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
await Donasi_funCreate(body as any, gambar).then((res) => {
|
const res = await Donasi_funCreate(body as any, gambar);
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
|
const dataNotif: any = {
|
||||||
|
appId: res.data?.id as any,
|
||||||
|
status: res.data?.DonasiMaster_Status?.name as any,
|
||||||
|
userId: res.data?.authorId as any,
|
||||||
|
pesan: res.data?.title as any,
|
||||||
|
kategoriApp: "DONASI",
|
||||||
|
title: "Donasi baru",
|
||||||
|
};
|
||||||
|
|
||||||
|
const notif = await notifikasiToAdmin_funCreate({
|
||||||
|
data: dataNotif as any,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (notif.status === 201) {
|
||||||
|
mqtt_client.publish(
|
||||||
|
"ADMIN",
|
||||||
|
JSON.stringify({
|
||||||
|
count: 1,
|
||||||
|
})
|
||||||
|
);
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
router.push(RouterDonasi.page_pop_up_create, { scroll: false });
|
|
||||||
setTabsPostingDonasi("Review");
|
setTabsPostingDonasi("Review");
|
||||||
setDonasiHotMenu(1);
|
setDonasiHotMenu(1);
|
||||||
} else {
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
toast(res.message);
|
router.push(RouterDonasi.main_galang_dana, { scroll: false });
|
||||||
}
|
}
|
||||||
});
|
} else {
|
||||||
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -26,14 +26,13 @@ import {
|
|||||||
ComponentGlobal_WarningMaxUpload,
|
ComponentGlobal_WarningMaxUpload,
|
||||||
maksimalUploadFile,
|
maksimalUploadFile,
|
||||||
} from "@/app_modules/_global/component/waring_popup";
|
} from "@/app_modules/_global/component/waring_popup";
|
||||||
|
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import toast from "react-simple-toasts";
|
|
||||||
import { NotifPeringatan } from "../component/notifikasi/notif_peringatan";
|
import { NotifPeringatan } from "../component/notifikasi/notif_peringatan";
|
||||||
import Donasi_funCreateTemporary from "../fun/create/fun_create_donasi_temporary";
|
import Donasi_funCreateTemporary from "../fun/create/fun_create_donasi_temporary";
|
||||||
import { gs_donasi_tabs_posting } from "../global_state";
|
import { gs_donasi_tabs_posting } from "../global_state";
|
||||||
import { MODEL_DONASI_ALL_MASTER } from "../model/interface";
|
import { MODEL_DONASI_ALL_MASTER } from "../model/interface";
|
||||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
|
||||||
|
|
||||||
export default function CreateDonasi({
|
export default function CreateDonasi({
|
||||||
masterKategori,
|
masterKategori,
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
Image,
|
Image,
|
||||||
Paper,
|
Paper,
|
||||||
Stack,
|
Stack,
|
||||||
|
Text,
|
||||||
TextInput,
|
TextInput,
|
||||||
Textarea,
|
Textarea,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
@@ -25,6 +26,13 @@ import ComponentDonasi_NotedBox from "../../component/noted_box";
|
|||||||
import { Donasi_funCreateNotif } from "../../fun/create/fun_create_notif";
|
import { Donasi_funCreateNotif } from "../../fun/create/fun_create_notif";
|
||||||
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||||
|
import {
|
||||||
|
AccentColor,
|
||||||
|
MainColor,
|
||||||
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import ComponentGlobal_BoxInformation from "@/app_modules/_global/component/box_information";
|
||||||
|
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||||
|
import ComponentGlobal_InputCountDown from "@/app_modules/_global/component/input_countdown";
|
||||||
|
|
||||||
export default function Donasi_CreateKabar({ donasiId }: { donasiId: string }) {
|
export default function Donasi_CreateKabar({ donasiId }: { donasiId: string }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -36,21 +44,33 @@ export default function Donasi_CreateKabar({ donasiId }: { donasiId: string }) {
|
|||||||
});
|
});
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack px={"lg"} pb={"lg"}>
|
||||||
<ComponentDonasi_NotedBox informasi="Gambar tidak wajib di isi ! Hanya upload jika di butuhkan." />
|
<ComponentGlobal_BoxInformation informasi="Gambar tidak wajib di isi ! Hanya upload jika di butuhkan." />
|
||||||
|
|
||||||
<TextInput
|
<TextInput
|
||||||
|
maxLength={100}
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
label="Judul"
|
label="Judul"
|
||||||
withAsterisk
|
withAsterisk
|
||||||
placeholder="Masukan judul kabar"
|
placeholder="Masukan judul kabar"
|
||||||
onChange={(val) => {
|
onChange={(val) => {
|
||||||
setKabar({
|
setKabar({
|
||||||
...kabar,
|
...kabar,
|
||||||
judul: val.target.value,
|
judul: _.startCase(val.target.value),
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Textarea
|
<Textarea
|
||||||
|
maxLength={500}
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
label="Deskripsi"
|
label="Deskripsi"
|
||||||
withAsterisk
|
withAsterisk
|
||||||
placeholder="Masukan deskripsi kabar"
|
placeholder="Masukan deskripsi kabar"
|
||||||
@@ -61,15 +81,36 @@ export default function Donasi_CreateKabar({ donasiId }: { donasiId: string }) {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
<ComponentGlobal_InputCountDown
|
||||||
|
lengthInput={kabar.deskripsi.length}
|
||||||
|
maxInput={500}
|
||||||
|
/>
|
||||||
|
|
||||||
<Stack>
|
<Stack>
|
||||||
<AspectRatio ratio={16 / 9}>
|
{imageKabar ? (
|
||||||
<Paper radius={"md"}>
|
<AspectRatio ratio={1 / 1} mah={300}>
|
||||||
<Image
|
<Paper
|
||||||
alt="Foto"
|
style={{
|
||||||
src={imageKabar ? imageKabar : "/aset/no-img.png"}
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
/>
|
backgroundColor: AccentColor.darkblue,
|
||||||
</Paper>
|
padding: "10px",
|
||||||
</AspectRatio>
|
borderRadius: "10px",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Image
|
||||||
|
alt="Foto"
|
||||||
|
src={imageKabar ? imageKabar : "/aset/no-img.png"}
|
||||||
|
maw={300}
|
||||||
|
/>
|
||||||
|
</Paper>
|
||||||
|
</AspectRatio>
|
||||||
|
) : (
|
||||||
|
<Center>
|
||||||
|
<Text fs={"italic"} fz={10} c={"white"}>
|
||||||
|
Upload gambar kabar !
|
||||||
|
</Text>
|
||||||
|
</Center>
|
||||||
|
)}
|
||||||
<Center>
|
<Center>
|
||||||
<FileButton
|
<FileButton
|
||||||
onChange={async (files: any | null) => {
|
onChange={async (files: any | null) => {
|
||||||
@@ -91,10 +132,10 @@ export default function Donasi_CreateKabar({ donasiId }: { donasiId: string }) {
|
|||||||
<Button
|
<Button
|
||||||
{...props}
|
{...props}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
variant="outline"
|
|
||||||
w={150}
|
|
||||||
leftIcon={<IconCamera />}
|
leftIcon={<IconCamera />}
|
||||||
compact
|
bg={MainColor.yellow}
|
||||||
|
color="yellow"
|
||||||
|
c={"black"}
|
||||||
>
|
>
|
||||||
Upload
|
Upload
|
||||||
</Button>
|
</Button>
|
||||||
@@ -103,8 +144,15 @@ export default function Donasi_CreateKabar({ donasiId }: { donasiId: string }) {
|
|||||||
</Center>
|
</Center>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Button
|
<Button
|
||||||
|
style={{
|
||||||
|
transition: "0.5s",
|
||||||
|
}}
|
||||||
|
disabled={_.values(kabar).includes("") ? true : false}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
mt={"lg"}
|
mt={"lg"}
|
||||||
|
bg={MainColor.yellow}
|
||||||
|
color="yellow"
|
||||||
|
c={"black"}
|
||||||
onClick={() => onSave(router, donasiId, kabar, file as any)}
|
onClick={() => onSave(router, donasiId, kabar, file as any)}
|
||||||
>
|
>
|
||||||
Simpan
|
Simpan
|
||||||
@@ -131,24 +179,17 @@ async function onSave(
|
|||||||
deskripsi: kabar.deskripsi,
|
deskripsi: kabar.deskripsi,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (_.values(body).includes("")) return NotifPeringatan("Lengkapi Data");
|
if (_.values(body).includes(""))
|
||||||
|
return ComponentGlobal_NotifikasiPeringatan("Lengkapi Data");
|
||||||
// if (!file) return NotifPeringatan("Lengkapi Gambar");
|
// if (!file) return NotifPeringatan("Lengkapi Gambar");
|
||||||
|
|
||||||
const gambar = new FormData();
|
const gambar = new FormData();
|
||||||
gambar.append("file", file as any);
|
gambar.append("file", file as any);
|
||||||
|
|
||||||
await Donasi_funCreateKabar(body as any, gambar).then(async (res) => {
|
const res = await Donasi_funCreateKabar(body as any, gambar);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
await Donasi_funCreateNotif(body.donasiId, res.kabarId as any).then(
|
// Notif ke setiap donatur
|
||||||
(val) => {
|
} else {
|
||||||
if (val.status === 200) {
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
ComponentGlobal_NotifikasiBerhasil(res.message);
|
}
|
||||||
router.back();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
ComponentGlobal_NotifikasiGagal(res.message);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate";
|
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate";
|
||||||
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
|
|
||||||
export default function LayoutDonasi_CreateKabar({
|
export default function LayoutDonasi_CreateKabar({
|
||||||
children,
|
children,
|
||||||
@@ -11,9 +13,9 @@ export default function LayoutDonasi_CreateKabar({
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate header={<ComponentDonasi_HeaderTamplate title="Buat Kabar" />}>
|
<UIGlobal_LayoutTamplate header={<UIGlobal_LayoutHeaderTamplate title="Tambah Kabar" />}>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,34 +1,13 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
import { Stack, Text, Title } from "@mantine/core";
|
||||||
import {
|
|
||||||
ActionIcon,
|
|
||||||
AspectRatio,
|
|
||||||
Avatar,
|
|
||||||
Divider,
|
|
||||||
Grid,
|
|
||||||
Group,
|
|
||||||
Image,
|
|
||||||
Paper,
|
|
||||||
Progress,
|
|
||||||
Stack,
|
|
||||||
Text,
|
|
||||||
Title,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import {
|
|
||||||
IconClover,
|
|
||||||
IconMessageChatbot,
|
|
||||||
IconMoneybag,
|
|
||||||
IconCircleChevronRight,
|
|
||||||
} from "@tabler/icons-react";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import ComponentDonasi_NotedBox from "../../component/noted_box";
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { MODEL_DONASI, MODEL_DONASI_INVOICE } from "../../model/interface";
|
import ComponentDonasi_CeritaPenggalangMain from "../../component/detail_main/cerita_penggalang";
|
||||||
import TampilanRupiahDonasi from "../../component/tampilan_rupiah";
|
|
||||||
import { ComponentDonasi_DetailDataMain } from "../../component/detail_main/detail_data_donasi";
|
import { ComponentDonasi_DetailDataMain } from "../../component/detail_main/detail_data_donasi";
|
||||||
import ComponentDonasi_InformasiPenggalangMain from "../../component/detail_main/informasi_penggalang";
|
import ComponentDonasi_InformasiPenggalangMain from "../../component/detail_main/informasi_penggalang";
|
||||||
import ComponentDonasi_CeritaPenggalangMain from "../../component/detail_main/cerita_penggalang";
|
import TampilanRupiahDonasi from "../../component/tampilan_rupiah";
|
||||||
|
import { MODEL_DONASI_INVOICE } from "../../model/interface";
|
||||||
|
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
|
||||||
export default function DetailDonasiSaya({
|
export default function DetailDonasiSaya({
|
||||||
dataDonasi,
|
dataDonasi,
|
||||||
@@ -40,27 +19,32 @@ export default function DetailDonasiSaya({
|
|||||||
const [invoice, setInvoice] = useState(dataDonasi);
|
const [invoice, setInvoice] = useState(dataDonasi);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack pb={"lg"}>
|
||||||
<Stack spacing={0}>
|
<Stack
|
||||||
|
spacing={0}
|
||||||
|
style={{
|
||||||
|
padding: "15px",
|
||||||
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
backgroundColor: AccentColor.darkblue,
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
}}
|
||||||
|
align={"center"}
|
||||||
|
>
|
||||||
<Text>Donasi Saya:</Text>
|
<Text>Donasi Saya:</Text>
|
||||||
<Title order={4} c={"blue"}>
|
<Title order={4} c={"blue"}>
|
||||||
<TampilanRupiahDonasi nominal={+invoice.nominal} />
|
<TampilanRupiahDonasi nominal={+invoice?.nominal} />
|
||||||
</Title>
|
</Title>
|
||||||
</Stack>
|
</Stack>
|
||||||
<ComponentDonasi_DetailDataMain
|
<ComponentDonasi_DetailDataMain
|
||||||
donasi={invoice.Donasi}
|
donasi={invoice?.Donasi}
|
||||||
countDonatur={countDonatur}
|
countDonatur={countDonatur}
|
||||||
/>
|
/>
|
||||||
<ComponentDonasi_InformasiPenggalangMain
|
<ComponentDonasi_InformasiPenggalangMain
|
||||||
author={invoice.Donasi.Author}
|
author={invoice?.Donasi.Author}
|
||||||
/>
|
/>
|
||||||
<ComponentDonasi_CeritaPenggalangMain donasi={invoice.Donasi} />
|
<ComponentDonasi_CeritaPenggalangMain donasi={invoice?.Donasi} />
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,13 +4,15 @@ import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi"
|
|||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate"
|
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate"
|
||||||
import React from "react"
|
import React from "react"
|
||||||
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate"
|
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate"
|
||||||
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate"
|
||||||
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate"
|
||||||
|
|
||||||
export default function LayoutDetailDonasiSaya({children}: {children: React.ReactNode}){
|
export default function LayoutDetailDonasiSaya({children}: {children: React.ReactNode}){
|
||||||
return<>
|
return<>
|
||||||
<AppComponentGlobal_LayoutTamplate
|
<UIGlobal_LayoutTamplate
|
||||||
header={<ComponentDonasi_HeaderTamplate title="Detail Donasi Saya" route={RouterDonasi.main_donasi_saya} />}
|
header={<UIGlobal_LayoutHeaderTamplate title="Detail Donasi Saya" routerLeft={RouterDonasi.main_donasi_saya} />}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
@@ -11,9 +11,10 @@ import { NotifPeringatan } from "../../component/notifikasi/notif_peringatan";
|
|||||||
import { Donasi_funGantiStatus } from "../../fun/update/fun_ganti_status";
|
import { Donasi_funGantiStatus } from "../../fun/update/fun_ganti_status";
|
||||||
import { gs_donasi_tabs_posting } from "../../global_state";
|
import { gs_donasi_tabs_posting } from "../../global_state";
|
||||||
import { MODEL_DONASI } from "../../model/interface";
|
import { MODEL_DONASI } from "../../model/interface";
|
||||||
import { useState } from "react";
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||||
import { Donasi_getOneById } from "../../fun/get/get_one_donasi_by_id";
|
import mqtt_client from "@/util/mqtt_client";
|
||||||
|
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
|
||||||
|
|
||||||
export default function DetailDraftDonasi({
|
export default function DetailDraftDonasi({
|
||||||
dataDonasi,
|
dataDonasi,
|
||||||
@@ -52,15 +53,31 @@ function ButtonAjukanPenggalangan({
|
|||||||
gs_donasi_tabs_posting
|
gs_donasi_tabs_posting
|
||||||
);
|
);
|
||||||
async function onCLick() {
|
async function onCLick() {
|
||||||
await Donasi_funGantiStatus(dataDonasi.id, "2").then((res) => {
|
const res = await Donasi_funGantiStatus(dataDonasi.id, "2");
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
router.push(RouterDonasi.main_galang_dana);
|
const dataNotif = {
|
||||||
|
appId: res.data?.id as any,
|
||||||
|
status: res.data?.DonasiMaster_Status?.name as any,
|
||||||
|
userId: res.data?.authorId as any,
|
||||||
|
pesan: res.data?.title as any,
|
||||||
|
kategoriApp: "DONASI",
|
||||||
|
title: "Mengajukan review",
|
||||||
|
};
|
||||||
|
|
||||||
|
const notif = await notifikasiToAdmin_funCreate({
|
||||||
|
data: dataNotif as any,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (notif.status === 201) {
|
||||||
|
mqtt_client.publish("ADMIN", JSON.stringify({ count: 1 }));
|
||||||
|
|
||||||
setTabsPostingDonasi("Review");
|
setTabsPostingDonasi("Review");
|
||||||
NotifBerhasil("Berhasil Diajukan");
|
ComponentGlobal_NotifikasiBerhasil("Berhasil Diajukan");
|
||||||
} else {
|
router.push(RouterDonasi.main_galang_dana);
|
||||||
NotifPeringatan(res.message);
|
|
||||||
}
|
}
|
||||||
});
|
} else {
|
||||||
|
ComponentGlobal_NotifikasiPeringatan(res.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -15,15 +15,27 @@ import {
|
|||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { MODEL_DONASI_KABAR } from "../../model/interface";
|
import { MODEL_DONASI_KABAR } from "../../model/interface";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
|
||||||
export default function DetailKabarDonasi({dataDonasi}: {dataDonasi: MODEL_DONASI_KABAR}) {
|
export default function DetailKabarDonasi({dataDonasi}: {dataDonasi: MODEL_DONASI_KABAR}) {
|
||||||
const [kabar, setKabar] = useState(dataDonasi)
|
const [kabar, setKabar] = useState(dataDonasi)
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack
|
||||||
|
style={{
|
||||||
|
backgroundColor: AccentColor.darkblue,
|
||||||
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
padding: "20px",
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
marginBottom: "15px",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Text fz={"xs"}>{moment(Date.now()).format("ll")}</Text>
|
<Group position="right">
|
||||||
<Title order={5}>{kabar.title}</Title>
|
<Text fz={"xs"}>{moment(Date.now()).format("ll")}</Text>
|
||||||
|
</Group>
|
||||||
|
<Title align="center" order={4}>{kabar.title}</Title>
|
||||||
{kabar.imagesId === null ? (
|
{kabar.imagesId === null ? (
|
||||||
""
|
""
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import FooterDonasi from "../../component/footer_close_donasi";
|
|
||||||
import ComponentDonasi_HeaderTamplate from "../../component/header_tamplate";
|
|
||||||
|
|
||||||
export default function LayoutDetailKabarDonasi({
|
export default function LayoutDetailKabarDonasi({
|
||||||
children,
|
children,
|
||||||
@@ -14,12 +13,12 @@ export default function LayoutDetailKabarDonasi({
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate
|
<UIGlobal_LayoutTamplate
|
||||||
header={<ComponentDonasi_HeaderTamplate title="Detail Kabar" hideBack={true} />}
|
header={<UIGlobal_LayoutHeaderTamplate title="Detail Kabar" />}
|
||||||
footer={<FooterDonasi />}
|
// footer={<FooterDonasi />}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,17 +10,19 @@ import React from "react";
|
|||||||
export default function LayoutCeritaPenggalangDonasi({
|
export default function LayoutCeritaPenggalangDonasi({
|
||||||
children,
|
children,
|
||||||
statusDonasiId,
|
statusDonasiId,
|
||||||
donasiId
|
donasiId,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
statusDonasiId: string;
|
statusDonasiId: string;
|
||||||
donasiId: string
|
donasiId: string;
|
||||||
}) {
|
}) {
|
||||||
if (statusDonasiId !== "1") {
|
if (statusDonasiId !== "1") {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<UIGlobal_LayoutTamplate
|
<UIGlobal_LayoutTamplate
|
||||||
header={<UIGlobal_LayoutHeaderTamplate title="Cerita Penggalang Dana" />}
|
header={
|
||||||
|
<UIGlobal_LayoutHeaderTamplate title="Cerita Penggalang Dana" />
|
||||||
|
}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</UIGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
@@ -28,11 +30,11 @@ export default function LayoutCeritaPenggalangDonasi({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<AppComponentGlobal_LayoutTamplate
|
<UIGlobal_LayoutTamplate
|
||||||
header={<ComponentDonasi_HeaderTamplate title="Cerita Penggalang Dana" />}
|
header={<UIGlobal_LayoutHeaderTamplate title="Cerita Penggalang Dana" />}
|
||||||
footer={<ButtonDonasi donasiId={donasiId}/>}
|
footer={<ButtonDonasi donasiId={donasiId} />}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,13 @@
|
|||||||
"use client";
|
"use client";
|
||||||
"use dev";
|
"use dev";
|
||||||
|
|
||||||
|
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
import ComponentDonasi_IsEmptyData from "@/app_modules/donasi/component/is_empty_data";
|
import ComponentDonasi_IsEmptyData from "@/app_modules/donasi/component/is_empty_data";
|
||||||
import TampilanRupiahDonasi from "@/app_modules/donasi/component/tampilan_rupiah";
|
import TampilanRupiahDonasi from "@/app_modules/donasi/component/tampilan_rupiah";
|
||||||
import { MODEL_DONASI_INVOICE } from "@/app_modules/donasi/model/interface";
|
import { MODEL_DONASI_INVOICE } from "@/app_modules/donasi/model/interface";
|
||||||
import {
|
import { Center, Grid, Group, Paper, Stack, Text, Title } from "@mantine/core";
|
||||||
Avatar,
|
import { IconMoodSmileBeam } from "@tabler/icons-react";
|
||||||
Center,
|
import _ from "lodash";
|
||||||
Grid,
|
|
||||||
Group,
|
|
||||||
Paper,
|
|
||||||
SimpleGrid,
|
|
||||||
Stack,
|
|
||||||
Text,
|
|
||||||
Title,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import { IconMoodSmile, IconMoodSmileBeam } from "@tabler/icons-react";
|
|
||||||
import _, { size } from "lodash";
|
|
||||||
import moment from "moment";
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
export default function DonaturDonasi({
|
export default function DonaturDonasi({
|
||||||
@@ -30,44 +20,45 @@ export default function DonaturDonasi({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SimpleGrid
|
{donatur.map((e, i) => (
|
||||||
cols={4}
|
<Paper
|
||||||
spacing="md"
|
key={i}
|
||||||
breakpoints={[
|
style={{
|
||||||
{ maxWidth: "62rem", cols: 3, spacing: "md" },
|
backgroundColor: AccentColor.blue,
|
||||||
{ maxWidth: "48rem", cols: 2, spacing: "sm" },
|
border: `2px solid ${AccentColor.darkblue}`,
|
||||||
{ maxWidth: "36rem", cols: 1, spacing: "sm" },
|
padding: "15px",
|
||||||
]}
|
cursor: "pointer",
|
||||||
>
|
borderRadius: "10px",
|
||||||
{donatur.map((e, i) => (
|
color: "white",
|
||||||
<Paper key={i} bg={"gray.1"} p={"sm"}>
|
marginBottom: "10px",
|
||||||
<Grid>
|
}}
|
||||||
<Grid.Col span={3}>
|
>
|
||||||
<Center h={"100%"}>
|
<Grid>
|
||||||
{/* <Avatar variant="filled" radius={"xl"} size={"md"} /> */}
|
<Grid.Col span={3}>
|
||||||
<IconMoodSmileBeam size={50} />
|
<Center h={"100%"}>
|
||||||
</Center>
|
{/* <Avatar variant="filled" radius={"xl"} size={"md"} /> */}
|
||||||
</Grid.Col>
|
<IconMoodSmileBeam size={50} />
|
||||||
<Grid.Col span={9}>
|
</Center>
|
||||||
<Stack spacing={0}>
|
</Grid.Col>
|
||||||
<Title order={5}>{e.Author.username}</Title>
|
<Grid.Col span={9}>
|
||||||
<Group spacing={"xs"}>
|
<Stack spacing={0}>
|
||||||
<Text fz={"xs"}>Berdonasi sebesar</Text>
|
<Title order={5}>{e.Author.username}</Title>
|
||||||
<Text truncate fw={"bold"}>
|
<Group spacing={"xs"}>
|
||||||
<TampilanRupiahDonasi nominal={+e.nominal} />
|
<Text fz={"xs"}>Berdonasi sebesar</Text>
|
||||||
</Text>
|
<Text truncate fw={"bold"}>
|
||||||
</Group>
|
<TampilanRupiahDonasi nominal={+e.nominal} />
|
||||||
<Text fz={"xs"}>
|
|
||||||
{new Intl.DateTimeFormat("id-ID", {
|
|
||||||
dateStyle: "full",
|
|
||||||
}).format(e?.createdAt)}
|
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Group>
|
||||||
</Grid.Col>
|
<Text fz={"xs"}>
|
||||||
</Grid>
|
{new Intl.DateTimeFormat("id-ID", {
|
||||||
</Paper>
|
dateStyle: "full",
|
||||||
))}
|
}).format(e?.createdAt)}
|
||||||
</SimpleGrid>
|
</Text>
|
||||||
|
</Stack>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</Paper>
|
||||||
|
))}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import ComponentDonasi_HeaderTamplate from "../../../component/header_tamplate";
|
|
||||||
|
|
||||||
export default function LayoutDonaturDonasi({
|
export default function LayoutDonaturDonasi({
|
||||||
children,
|
children,
|
||||||
@@ -11,9 +11,11 @@ export default function LayoutDonaturDonasi({
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate header={<ComponentDonasi_HeaderTamplate title="Donatur" />}>
|
<UIGlobal_LayoutTamplate
|
||||||
|
header={<UIGlobal_LayoutHeaderTamplate title="Donatur" />}
|
||||||
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,11 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
|
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||||
import ComponentDonasi_ListKabar from "@/app_modules/donasi/component/detail_main/list_kabar";
|
import ComponentDonasi_ListKabar from "@/app_modules/donasi/component/detail_main/list_kabar";
|
||||||
import ComponentDonasi_IsEmptyData from "@/app_modules/donasi/component/is_empty_data";
|
|
||||||
import { MODEL_DONASI_KABAR } from "@/app_modules/donasi/model/interface";
|
import { MODEL_DONASI_KABAR } from "@/app_modules/donasi/model/interface";
|
||||||
import {
|
import { Box } from "@mantine/core";
|
||||||
ActionIcon,
|
|
||||||
Avatar,
|
|
||||||
Box,
|
|
||||||
Group,
|
|
||||||
Paper,
|
|
||||||
SimpleGrid,
|
|
||||||
Spoiler,
|
|
||||||
Stack,
|
|
||||||
Text,
|
|
||||||
Title,
|
|
||||||
} from "@mantine/core";
|
|
||||||
import { IconCircleChevronRight } from "@tabler/icons-react";
|
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import moment from "moment";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
export default function KabarDonasi({
|
export default function KabarDonasi({
|
||||||
@@ -27,31 +13,21 @@ export default function KabarDonasi({
|
|||||||
}: {
|
}: {
|
||||||
listKabar: MODEL_DONASI_KABAR[];
|
listKabar: MODEL_DONASI_KABAR[];
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
|
||||||
const [kabar, setKabar] = useState(listKabar);
|
const [kabar, setKabar] = useState(listKabar);
|
||||||
|
|
||||||
if (_.isEmpty(kabar)) return <ComponentDonasi_IsEmptyData />;
|
if (_.isEmpty(kabar)) return <ComponentGlobal_IsEmptyData />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<SimpleGrid
|
{kabar.map((e, i) => (
|
||||||
cols={4}
|
<Box key={i}>
|
||||||
spacing="lg"
|
<ComponentDonasi_ListKabar
|
||||||
breakpoints={[
|
kabar={e}
|
||||||
{ maxWidth: "62rem", cols: 3, spacing: "md" },
|
route={RouterDonasi.detail_kabar}
|
||||||
{ maxWidth: "48rem", cols: 2, spacing: "sm" },
|
/>
|
||||||
{ maxWidth: "36rem", cols: 1, spacing: "sm" },
|
</Box>
|
||||||
]}
|
))}
|
||||||
>
|
|
||||||
{kabar.map((e, i) => (
|
|
||||||
<Box key={i}>
|
|
||||||
<ComponentDonasi_ListKabar
|
|
||||||
kabar={e}
|
|
||||||
route={RouterDonasi.detail_kabar}
|
|
||||||
/>
|
|
||||||
</Box>
|
|
||||||
))}
|
|
||||||
</SimpleGrid>
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { AppShell } from "@mantine/core";
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import ComponentDonasi_HeaderTamplate from "../../../component/header_tamplate";
|
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
|
||||||
|
|
||||||
export default function LayoutKabarDonasi({
|
export default function LayoutKabarDonasi({
|
||||||
children,
|
children,
|
||||||
@@ -12,11 +11,11 @@ export default function LayoutKabarDonasi({
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate
|
<UIGlobal_LayoutTamplate
|
||||||
header={<ComponentDonasi_HeaderTamplate title="Kabar Terbaru" />}
|
header={<UIGlobal_LayoutHeaderTamplate title="Kabar Terbaru" />}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export default function DetailPublishDonasi({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <pre>{JSON.stringify(donasi,null,2)}</pre> */}
|
{/* <pre>{JSON.stringify(donasi,null,2)}</pre> */}
|
||||||
<Stack spacing={40}>
|
<Stack spacing={"xl"} pb={"lg"}>
|
||||||
<ComponentDonasi_DetailDataMain donasi={donasi} countDonatur={countDonatur} userLoginId={userLoginId}/>
|
<ComponentDonasi_DetailDataMain donasi={donasi} countDonatur={countDonatur} userLoginId={userLoginId}/>
|
||||||
<ComponentDonasi_InformasiPenggalangMain author={donasi.Author}/>
|
<ComponentDonasi_InformasiPenggalangMain author={donasi.Author}/>
|
||||||
<ComponentDonasi_CeritaPenggalangMain donasi={donasi} />
|
<ComponentDonasi_CeritaPenggalangMain donasi={donasi} />
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export default function LayoutDetailPublishDonasi({
|
|||||||
const listPage = [
|
const listPage = [
|
||||||
{
|
{
|
||||||
id: "1",
|
id: "1",
|
||||||
name: "Kabar",
|
name: "Daftar Kabar",
|
||||||
icon: <IconMessageShare />,
|
icon: <IconMessageShare />,
|
||||||
path: RouterDonasi.list_kabar + donasiId,
|
path: RouterDonasi.list_kabar + donasiId,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,21 +1,19 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
import {
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
Button,
|
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||||
Stack
|
import { Button, Stack } from "@mantine/core";
|
||||||
} from "@mantine/core";
|
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ComponentDonasi_DetailDataGalangDana from "../../component/detail_galang_dana/detail_data_donasi";
|
import ComponentDonasi_DetailDataGalangDana from "../../component/detail_galang_dana/detail_data_donasi";
|
||||||
import ComponentDonasi_CeritaPenggalangMain from "../../component/detail_main/cerita_penggalang";
|
import ComponentDonasi_CeritaPenggalangMain from "../../component/detail_main/cerita_penggalang";
|
||||||
import { NotifBerhasil } from "../../component/notifikasi/notif_berhasil";
|
|
||||||
import { NotifPeringatan } from "../../component/notifikasi/notif_peringatan";
|
|
||||||
import { Donasi_funGantiStatus } from "../../fun/update/fun_ganti_status";
|
import { Donasi_funGantiStatus } from "../../fun/update/fun_ganti_status";
|
||||||
import { gs_donasi_tabs_posting } from "../../global_state";
|
import { gs_donasi_tabs_posting } from "../../global_state";
|
||||||
import { MODEL_DONASI } from "../../model/interface";
|
import { MODEL_DONASI } from "../../model/interface";
|
||||||
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
|
||||||
|
import mqtt_client from "@/util/mqtt_client";
|
||||||
|
|
||||||
export default function DetailReviewDonasi({
|
export default function DetailReviewDonasi({
|
||||||
dataDonasi,
|
dataDonasi,
|
||||||
@@ -42,16 +40,32 @@ function ButtonBatalReview({ donasi }: { donasi: MODEL_DONASI }) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
async function onCLick() {
|
async function onCLick() {
|
||||||
await Donasi_funGantiStatus(donasi.id, "3").then((res) => {
|
const res = await Donasi_funGantiStatus(donasi.id, "3");
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
|
const dataNotif = {
|
||||||
|
appId: res.data?.id as any,
|
||||||
|
status: res.data?.DonasiMaster_Status?.name as any,
|
||||||
|
userId: res.data?.authorId as any,
|
||||||
|
pesan: res.data?.title as any,
|
||||||
|
kategoriApp: "DONASI",
|
||||||
|
title: "Membatalkan review",
|
||||||
|
};
|
||||||
|
|
||||||
|
const notif = await notifikasiToAdmin_funCreate({
|
||||||
|
data: dataNotif as any,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (notif.status === 201) {
|
||||||
|
mqtt_client.publish("ADMIN", JSON.stringify({ count: 1 }));
|
||||||
|
|
||||||
setTabsPostingDonasi("Draft");
|
setTabsPostingDonasi("Draft");
|
||||||
NotifBerhasil("Berhasil Dibatalkan");
|
ComponentGlobal_NotifikasiBerhasil("Berhasil Dibatalkan");
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
router.push(RouterDonasi.main_galang_dana);
|
router.push(RouterDonasi.main_galang_dana);
|
||||||
} else {
|
|
||||||
NotifPeringatan(res.message);
|
|
||||||
}
|
}
|
||||||
});
|
} else {
|
||||||
|
ComponentGlobal_NotifikasiPeringatan(res.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import { useRouter } from "next/navigation";
|
|||||||
import { MODEL_DONASI_KABAR } from "../../model/interface";
|
import { MODEL_DONASI_KABAR } from "../../model/interface";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ComponentDonasi_ListKabar from "../../component/detail_main/list_kabar";
|
import ComponentDonasi_ListKabar from "../../component/detail_main/list_kabar";
|
||||||
|
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
|
||||||
export default function ListKabarDonasi({
|
export default function ListKabarDonasi({
|
||||||
donasiId,
|
donasiId,
|
||||||
@@ -41,24 +42,20 @@ export default function ListKabarDonasi({
|
|||||||
leftIcon={<IconCirclePlus />}
|
leftIcon={<IconCirclePlus />}
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
onClick={() => router.push(RouterDonasi.create_kabar + `${donasiId}`)}
|
onClick={() => router.push(RouterDonasi.create_kabar + `${donasiId}`)}
|
||||||
|
bg={MainColor.yellow}
|
||||||
|
color="yellow"
|
||||||
|
c={"black"}
|
||||||
>
|
>
|
||||||
Tambah Kabar
|
Tambah Kabar
|
||||||
</Button>
|
</Button>
|
||||||
<SimpleGrid
|
{kabar.map((e, i) => (
|
||||||
cols={4}
|
<Box key={i}>
|
||||||
spacing="lg"
|
<ComponentDonasi_ListKabar
|
||||||
breakpoints={[
|
kabar={e}
|
||||||
{ maxWidth: "62rem", cols: 3, spacing: "md" },
|
route={RouterDonasi.update_kabar}
|
||||||
{ maxWidth: "48rem", cols: 2, spacing: "sm" },
|
/>
|
||||||
{ maxWidth: "36rem", cols: 1, spacing: "sm" },
|
</Box>
|
||||||
]}
|
))}
|
||||||
>
|
|
||||||
{kabar.map((e, i) => (
|
|
||||||
<Box key={i}>
|
|
||||||
<ComponentDonasi_ListKabar kabar={e} route={RouterDonasi.update_kabar}/>
|
|
||||||
</Box>
|
|
||||||
))}
|
|
||||||
</SimpleGrid>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
import ComponentDonasi_HeaderTamplate from "@/app_modules/donasi/component/header_tamplate";
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
import { AppShell } from "@mantine/core";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export default function LayoutListKabarDonasi({
|
export default function LayoutListKabarDonasi({
|
||||||
@@ -12,10 +11,10 @@ export default function LayoutListKabarDonasi({
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate
|
<UIGlobal_LayoutTamplate
|
||||||
header={<ComponentDonasi_HeaderTamplate title="List Kabar" />}>
|
header={<UIGlobal_LayoutHeaderTamplate title="Daftar Kabar" />}>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,10 @@ import {
|
|||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { MODEL_DONASI_KABAR } from "../../model/interface";
|
import { MODEL_DONASI_KABAR } from "../../model/interface";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import {
|
||||||
|
AccentColor,
|
||||||
|
MainColor,
|
||||||
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
|
|
||||||
export default function UpdateKabarDonasi({
|
export default function UpdateKabarDonasi({
|
||||||
dataKabar,
|
dataKabar,
|
||||||
@@ -24,10 +28,23 @@ export default function UpdateKabarDonasi({
|
|||||||
const [kabar, setKabar] = useState(dataKabar);
|
const [kabar, setKabar] = useState(dataKabar);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack
|
||||||
|
style={{
|
||||||
|
backgroundColor: AccentColor.darkblue,
|
||||||
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
padding: "20px",
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
marginBottom: "15px",
|
||||||
|
}}
|
||||||
|
>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Text fz={"xs"}>{moment(Date.now()).format("ll")}</Text>
|
<Group position="right">
|
||||||
<Title order={5}>{kabar.title}</Title>
|
<Text fz={"xs"}>{moment(Date.now()).format("ll")}</Text>
|
||||||
|
</Group>
|
||||||
|
<Title align="center" order={4}>
|
||||||
|
{kabar.title}
|
||||||
|
</Title>
|
||||||
{kabar.imagesId === null ? (
|
{kabar.imagesId === null ? (
|
||||||
""
|
""
|
||||||
) : (
|
) : (
|
||||||
|
|||||||
@@ -18,6 +18,8 @@ import { Donasi_funDeleteKabar } from "../../fun/delete/fun_delete.kabar";
|
|||||||
import { NotifBerhasil } from "../../component/notifikasi/notif_berhasil";
|
import { NotifBerhasil } from "../../component/notifikasi/notif_berhasil";
|
||||||
import { NotifGagal } from "../../component/notifikasi/notif_gagal";
|
import { NotifGagal } from "../../component/notifikasi/notif_gagal";
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||||
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
|
|
||||||
export default function LayoutUpdateKabarDonasi({
|
export default function LayoutUpdateKabarDonasi({
|
||||||
children,
|
children,
|
||||||
@@ -30,28 +32,25 @@ export default function LayoutUpdateKabarDonasi({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate
|
<UIGlobal_LayoutTamplate
|
||||||
header={<ComponentDonasi_HeaderTamplate title="Update Kabar" />}
|
header={<UIGlobal_LayoutHeaderTamplate title="Update Kabar" />}
|
||||||
footer={
|
footer={
|
||||||
<Footer height={70}>
|
<Group align="center" h={"100%"} position="center" spacing={"xl"}>
|
||||||
<Group align="center" h={"100%"} position="center" spacing={"xl"}>
|
{/* <Button radius={"xl"} variant="outline" color="green">
|
||||||
{/* <Button radius={"xl"} variant="outline" color="green">
|
|
||||||
Edit
|
Edit
|
||||||
</Button> */}
|
</Button> */}
|
||||||
<Button
|
<Button
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
variant="outline"
|
color="red"
|
||||||
color="red"
|
onClick={() => onDelete(router, kabarId)}
|
||||||
onClick={() => onDelete(router, kabarId)}
|
>
|
||||||
>
|
Hapus
|
||||||
Hapus
|
</Button>
|
||||||
</Button>
|
</Group>
|
||||||
</Group>
|
|
||||||
</Footer>
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,16 @@ export async function Donasi_funCreate(req: MODEL_DONASI, file: FormData) {
|
|||||||
namaBank: body.namaBank,
|
namaBank: body.namaBank,
|
||||||
rekening: body.rekening,
|
rekening: body.rekening,
|
||||||
},
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
title: true,
|
||||||
|
authorId: true,
|
||||||
|
DonasiMaster_Status: {
|
||||||
|
select: {
|
||||||
|
name: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!dataDonasi) return { status: 400, message: "Gagal disimpan" };
|
if (!dataDonasi) return { status: 400, message: "Gagal disimpan" };
|
||||||
@@ -62,6 +72,7 @@ export async function Donasi_funCreate(req: MODEL_DONASI, file: FormData) {
|
|||||||
if (!dataCerita) return { status: 400, message: "Gagal simpan data cerita" };
|
if (!dataCerita) return { status: 400, message: "Gagal simpan data cerita" };
|
||||||
revalidatePath("/dev/donasi/main/galang_dana");
|
revalidatePath("/dev/donasi/main/galang_dana");
|
||||||
return {
|
return {
|
||||||
|
data: dataDonasi,
|
||||||
status: 201,
|
status: 201,
|
||||||
message: "Data donasi tersimpan",
|
message: "Data donasi tersimpan",
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -9,16 +9,30 @@ export async function Donasi_funCreateInvoice(data: any) {
|
|||||||
donasiId: data.donasiId,
|
donasiId: data.donasiId,
|
||||||
nominal: data.nominal,
|
nominal: data.nominal,
|
||||||
donasiMaster_BankId: data.donasiMaster_BankId,
|
donasiMaster_BankId: data.donasiMaster_BankId,
|
||||||
authorId: data.authorId
|
authorId: data.authorId,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
DonasiMaster_StatusInvoice: {
|
||||||
|
select: {
|
||||||
|
name: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Donasi: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
title: true,
|
||||||
|
authorId: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
if (!res) return { status: 400, message: "Gagal membuat invoice" };
|
if (!res) return { status: 400, message: "Gagal membuat invoice" };
|
||||||
revalidatePath("/dev/donasi/main/donasi_saya")
|
revalidatePath("/dev/donasi/main/donasi_saya");
|
||||||
return {
|
return {
|
||||||
status: 200,
|
status: 200,
|
||||||
message: "Berhasil membuat invoice",
|
message: "Berhasil membuat invoice",
|
||||||
invoiceId: res.id
|
data: res,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,16 +12,6 @@ export async function Donasi_funCreateKabar(
|
|||||||
req: MODEL_DONASI_KABAR | any,
|
req: MODEL_DONASI_KABAR | any,
|
||||||
file: FormData
|
file: FormData
|
||||||
) {
|
) {
|
||||||
const create = await prisma.donasi_Kabar.create({
|
|
||||||
data: {
|
|
||||||
title: req.title,
|
|
||||||
deskripsi: req.deskripsi,
|
|
||||||
donasiId: req.donasiId,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!create) return { status: 400, message: "Gagal membuat data" };
|
|
||||||
|
|
||||||
const dataImage: any = file.get("file");
|
const dataImage: any = file.get("file");
|
||||||
if (dataImage !== "null") {
|
if (dataImage !== "null") {
|
||||||
const fileName = dataImage.name;
|
const fileName = dataImage.name;
|
||||||
@@ -43,24 +33,53 @@ export async function Donasi_funCreateKabar(
|
|||||||
const uploadFolder = Buffer.from(await dataImage.arrayBuffer());
|
const uploadFolder = Buffer.from(await dataImage.arrayBuffer());
|
||||||
fs.writeFileSync(`./public/donasi/kabar/${upload.url}`, uploadFolder);
|
fs.writeFileSync(`./public/donasi/kabar/${upload.url}`, uploadFolder);
|
||||||
|
|
||||||
const updateKabar = await prisma.donasi_Kabar.update({
|
const createWithPhoto = await prisma.donasi_Kabar.create({
|
||||||
where: {
|
|
||||||
id: create.id,
|
|
||||||
},
|
|
||||||
data: {
|
data: {
|
||||||
|
title: req.title,
|
||||||
|
deskripsi: req.deskripsi,
|
||||||
|
donasiId: req.donasiId,
|
||||||
imagesId: upload.id,
|
imagesId: upload.id,
|
||||||
},
|
},
|
||||||
|
select: {
|
||||||
|
Donasi: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
title: true,
|
||||||
|
authorId: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!updateKabar) return { status: 400, message: "Gagal upload gambar" };
|
if (!createWithPhoto) return { status: 400, message: "Gagal membuat data" };
|
||||||
|
return {
|
||||||
|
status: 200,
|
||||||
|
message: "Berhasil disimpan",
|
||||||
|
data: createWithPhoto,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const create = await prisma.donasi_Kabar.create({
|
||||||
|
data: {
|
||||||
|
title: req.title,
|
||||||
|
deskripsi: req.deskripsi,
|
||||||
|
donasiId: req.donasiId,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
Donasi: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
title: true,
|
||||||
|
authorId: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
revalidatePath("/dev/donasi/list_kabar");
|
revalidatePath("/dev/donasi/list_kabar");
|
||||||
return {
|
return {
|
||||||
status: 200,
|
status: 200,
|
||||||
message: "Berhasil disimpan",
|
message: "Berhasil disimpan",
|
||||||
kabarId: create.id
|
data: create,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,14 +27,16 @@ export default async function Donasi_getByStatus(
|
|||||||
publishTime: true,
|
publishTime: true,
|
||||||
DonasiMaster_Durasi: true,
|
DonasiMaster_Durasi: true,
|
||||||
terkumpul: true,
|
terkumpul: true,
|
||||||
|
},
|
||||||
}
|
|
||||||
});
|
});
|
||||||
return getReview;
|
return getReview;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status === "2") {
|
if (status === "2") {
|
||||||
const getReview = await prisma.donasi.findMany({
|
const getReview = await prisma.donasi.findMany({
|
||||||
|
orderBy: {
|
||||||
|
updatedAt: "desc",
|
||||||
|
},
|
||||||
where: {
|
where: {
|
||||||
authorId: authorId,
|
authorId: authorId,
|
||||||
donasiMaster_StatusDonasiId: "2",
|
donasiMaster_StatusDonasiId: "2",
|
||||||
@@ -67,9 +69,7 @@ export default async function Donasi_getByStatus(
|
|||||||
publishTime: true,
|
publishTime: true,
|
||||||
DonasiMaster_Durasi: true,
|
DonasiMaster_Durasi: true,
|
||||||
catatan: true,
|
catatan: true,
|
||||||
|
},
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
return getReview;
|
return getReview;
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
"use server";
|
||||||
|
|
||||||
|
import prisma from "@/app/lib/prisma";
|
||||||
|
|
||||||
|
export async function donasi_getOneStatusInvoiceById({
|
||||||
|
invoiceId,
|
||||||
|
}: {
|
||||||
|
invoiceId: string;
|
||||||
|
}) {
|
||||||
|
const res = await prisma.donasi_Invoice.findFirst({
|
||||||
|
where: {
|
||||||
|
id: invoiceId,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
authorId: true,
|
||||||
|
donasiMaster_StatusInvoiceId: true,
|
||||||
|
DonasiMaster_StatusInvoice: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
@@ -22,6 +22,16 @@ export async function Donasi_funGantiStatus(
|
|||||||
data: {
|
data: {
|
||||||
donasiMaster_StatusDonasiId: statusId,
|
donasiMaster_StatusDonasiId: statusId,
|
||||||
},
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
title: true,
|
||||||
|
authorId: true,
|
||||||
|
DonasiMaster_Status: {
|
||||||
|
select: {
|
||||||
|
name: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -29,6 +39,7 @@ export async function Donasi_funGantiStatus(
|
|||||||
|
|
||||||
revalidatePath(RouterDonasi.main_galang_dana)
|
revalidatePath(RouterDonasi.main_galang_dana)
|
||||||
return {
|
return {
|
||||||
|
data: data,
|
||||||
status: 200,
|
status: 200,
|
||||||
message: "Status berhasil diganti",
|
message: "Status berhasil diganti",
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,22 +7,39 @@ export async function Donasi_funUpdateStatusInvoice(
|
|||||||
invoiceId: string,
|
invoiceId: string,
|
||||||
statusId: string
|
statusId: string
|
||||||
) {
|
) {
|
||||||
// console.log(invoiceId, "invoice Id");
|
// console.log(invoiceId, "invoice Id");
|
||||||
// console.log(status, "status");
|
// console.log(status, "status");
|
||||||
|
|
||||||
const data = await prisma.donasi_Invoice.update({
|
const data = await prisma.donasi_Invoice.update({
|
||||||
where: {
|
where: {
|
||||||
id: invoiceId
|
id: invoiceId,
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
donasiMaster_StatusInvoiceId: statusId
|
donasiMaster_StatusInvoiceId: statusId,
|
||||||
}
|
},
|
||||||
})
|
select: {
|
||||||
|
id: true,
|
||||||
|
DonasiMaster_StatusInvoice: {
|
||||||
|
select: {
|
||||||
|
name: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
Donasi: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
title: true,
|
||||||
|
authorId: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
if(!data) return {status: 400, message: "Gagal memperbarui status transaksi"}
|
if (!data)
|
||||||
revalidatePath("dev/admin/donasi/detail/publish")
|
return { status: 400, message: "Gagal memperbarui status transaksi" };
|
||||||
return {
|
revalidatePath("dev/admin/donasi/detail/publish");
|
||||||
|
return {
|
||||||
|
data: data,
|
||||||
status: 200,
|
status: 200,
|
||||||
message: "Berhasil memperbarui status transaksi",
|
message: "Berhasil memperbarui status transaksi",
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { atomWithStorage } from "jotai/utils";
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param index 0 - 2
|
* @param index 0 - 2
|
||||||
|
* @type number
|
||||||
* @returns global state hot menu donasi
|
* @returns global state hot menu donasi
|
||||||
*/
|
*/
|
||||||
export const gs_donasi_hot_menu = atomWithStorage("gs_donasi_hot_menu", 0);
|
export const gs_donasi_hot_menu = atomWithStorage("gs_donasi_hot_menu", 0);
|
||||||
|
|||||||
@@ -29,6 +29,10 @@ import {
|
|||||||
AccentColor,
|
AccentColor,
|
||||||
MainColor,
|
MainColor,
|
||||||
} from "@/app_modules/_global/color/color_pallet";
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
|
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||||
|
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
|
||||||
|
import mqtt_client from "@/util/mqtt_client";
|
||||||
|
|
||||||
export default function Donasi_InvoiceProses({
|
export default function Donasi_InvoiceProses({
|
||||||
dataInvoice,
|
dataInvoice,
|
||||||
@@ -80,7 +84,7 @@ export default function Donasi_InvoiceProses({
|
|||||||
</Stack>
|
</Stack>
|
||||||
<Paper
|
<Paper
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: AccentColor.softblue,
|
backgroundColor: AccentColor.darkblue,
|
||||||
border: `2px solid ${AccentColor.blue}`,
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
padding: "15px",
|
padding: "15px",
|
||||||
cursor: "pointer",
|
cursor: "pointer",
|
||||||
@@ -107,6 +111,7 @@ export default function Donasi_InvoiceProses({
|
|||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
onClick={copy}
|
onClick={copy}
|
||||||
color={copied ? "teal" : "yellow"}
|
color={copied ? "teal" : "yellow"}
|
||||||
|
c={"black"}
|
||||||
>
|
>
|
||||||
{copied ? "Berhasil" : "Salin"}
|
{copied ? "Berhasil" : "Salin"}
|
||||||
</Button>
|
</Button>
|
||||||
@@ -136,7 +141,7 @@ export default function Donasi_InvoiceProses({
|
|||||||
</Stack>
|
</Stack>
|
||||||
<Paper
|
<Paper
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: AccentColor.softblue,
|
backgroundColor: AccentColor.darkblue,
|
||||||
border: `2px solid ${AccentColor.blue}`,
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
padding: "15px",
|
padding: "15px",
|
||||||
cursor: "pointer",
|
cursor: "pointer",
|
||||||
@@ -163,6 +168,7 @@ export default function Donasi_InvoiceProses({
|
|||||||
variant="filled"
|
variant="filled"
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
color={copied ? "teal" : "yellow"}
|
color={copied ? "teal" : "yellow"}
|
||||||
|
c={"black"}
|
||||||
onClick={copy}
|
onClick={copy}
|
||||||
>
|
>
|
||||||
{copied ? "Berhasil" : "Salin"}
|
{copied ? "Berhasil" : "Salin"}
|
||||||
@@ -215,6 +221,7 @@ export default function Donasi_InvoiceProses({
|
|||||||
leftIcon={<IconCamera />}
|
leftIcon={<IconCamera />}
|
||||||
bg={MainColor.yellow}
|
bg={MainColor.yellow}
|
||||||
color="yellow"
|
color="yellow"
|
||||||
|
c={"black"}
|
||||||
>
|
>
|
||||||
Upload
|
Upload
|
||||||
</Button>
|
</Button>
|
||||||
@@ -271,15 +278,35 @@ async function onClick(
|
|||||||
invoiceId: string,
|
invoiceId: string,
|
||||||
setActive: any
|
setActive: any
|
||||||
) {
|
) {
|
||||||
await Donasi_funUpdateStatusInvoice(invoiceId, "2").then((res) => {
|
const res = await Donasi_funUpdateStatusInvoice(invoiceId, "2");
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
NotifBerhasil(res.message);
|
const dataNotif: any = {
|
||||||
|
appId: res.data?.Donasi?.id as any,
|
||||||
|
userId: res.data?.Donasi?.authorId as any,
|
||||||
|
pesan: res.data?.Donasi?.title as any,
|
||||||
|
status: res.data?.DonasiMaster_StatusInvoice?.name,
|
||||||
|
kategoriApp: "DONASI",
|
||||||
|
title: "Donatur melakukan transfer",
|
||||||
|
};
|
||||||
|
|
||||||
|
const notif = await notifikasiToAdmin_funCreate({
|
||||||
|
data: dataNotif as any,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (notif.status === 201) {
|
||||||
|
mqtt_client.publish(
|
||||||
|
"ADMIN",
|
||||||
|
JSON.stringify({
|
||||||
|
count: 1,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
setActive(2);
|
setActive(2);
|
||||||
router.push(RouterDonasi.proses_transaksi + `${invoiceId}`);
|
router.push(RouterDonasi.proses_transaksi + `${invoiceId}`);
|
||||||
} else {
|
|
||||||
NotifGagal(res.message);
|
|
||||||
}
|
}
|
||||||
});
|
} else {
|
||||||
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onUpload(invoiceId: string, file: FormData) {
|
async function onUpload(invoiceId: string, file: FormData) {
|
||||||
|
|||||||
@@ -16,6 +16,10 @@ import {
|
|||||||
AccentColor,
|
AccentColor,
|
||||||
MainColor,
|
MainColor,
|
||||||
} from "@/app_modules/_global/color/color_pallet";
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
|
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||||
|
import mqtt_client from "@/util/mqtt_client";
|
||||||
|
import notifikasiToAdmin_funCreate from "@/app_modules/notifikasi/fun/create/create_notif_to_admin";
|
||||||
|
|
||||||
export default function Donasi_MetodePembayaran({
|
export default function Donasi_MetodePembayaran({
|
||||||
listBank,
|
listBank,
|
||||||
@@ -42,19 +46,39 @@ export default function Donasi_MetodePembayaran({
|
|||||||
|
|
||||||
// console.log(body)
|
// console.log(body)
|
||||||
|
|
||||||
await Donasi_funCreateInvoice(body).then((res) => {
|
const res = await Donasi_funCreateInvoice(body);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
|
const dataNotif = {
|
||||||
|
appId: res.data?.Donasi?.id as any,
|
||||||
|
userId: res.data?.Donasi?.authorId as any,
|
||||||
|
pesan: res.data?.Donasi?.title as any,
|
||||||
|
status: res.data?.DonasiMaster_StatusInvoice?.name,
|
||||||
|
kategoriApp: "DONASI",
|
||||||
|
title: "Donatur mengirim invoice",
|
||||||
|
};
|
||||||
|
|
||||||
|
const notif = await notifikasiToAdmin_funCreate({
|
||||||
|
data: dataNotif as any,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (notif.status === 201) {
|
||||||
|
mqtt_client.publish(
|
||||||
|
"ADMIN",
|
||||||
|
JSON.stringify({
|
||||||
|
count: 1,
|
||||||
|
})
|
||||||
|
);
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
NotifBerhasil(res.message);
|
ComponentGlobal_NotifikasiBerhasil(res.message);
|
||||||
router.push(RouterDonasi.invoice + `${res.invoiceId}`);
|
|
||||||
setProsesDonasi({
|
setProsesDonasi({
|
||||||
...prosesDonasi,
|
...prosesDonasi,
|
||||||
nominal: "",
|
nominal: "",
|
||||||
});
|
});
|
||||||
} else {
|
router.push(RouterDonasi.invoice + `${res.data?.id}`);
|
||||||
NotifGagal(res.message);
|
|
||||||
}
|
}
|
||||||
});
|
} else {
|
||||||
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -67,7 +91,6 @@ export default function Donasi_MetodePembayaran({
|
|||||||
onChange={setPilihBank}
|
onChange={setPilihBank}
|
||||||
withAsterisk
|
withAsterisk
|
||||||
color="yellow"
|
color="yellow"
|
||||||
|
|
||||||
>
|
>
|
||||||
{bank.map((e, i) => (
|
{bank.map((e, i) => (
|
||||||
<Paper
|
<Paper
|
||||||
@@ -83,11 +106,11 @@ export default function Donasi_MetodePembayaran({
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Radio
|
<Radio
|
||||||
styles={{
|
styles={{
|
||||||
radio: {
|
radio: {
|
||||||
color: "yellow"
|
color: "yellow",
|
||||||
}
|
},
|
||||||
}}
|
}}
|
||||||
value={e.id}
|
value={e.id}
|
||||||
label={
|
label={
|
||||||
<Title order={6} color="white">
|
<Title order={6} color="white">
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
|
||||||
import { Warna } from "@/app/lib/warna";
|
import { Warna } from "@/app/lib/warna";
|
||||||
|
import {
|
||||||
|
AccentColor,
|
||||||
|
MainColor,
|
||||||
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
import {
|
import {
|
||||||
Center,
|
Center,
|
||||||
Group,
|
Group,
|
||||||
@@ -11,120 +14,76 @@ import {
|
|||||||
Text,
|
Text,
|
||||||
Title,
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useInterval, useShallowEffect } from "@mantine/hooks";
|
|
||||||
import { IconBrandWhatsapp } from "@tabler/icons-react";
|
import { IconBrandWhatsapp } from "@tabler/icons-react";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import moment from "moment";
|
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { redirect } from "next/navigation";
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { Donasi_getOneInvoiceById } from "../../fun/get/get_one_invoice_by_id";
|
|
||||||
import { gs_donasi_hot_menu } from "../../global_state";
|
import { gs_donasi_hot_menu } from "../../global_state";
|
||||||
import { MODEL_DONASI_INVOICE } from "../../model/interface";
|
import { MODEL_DONASI_INVOICE } from "../../model/interface";
|
||||||
import {
|
import { redirect, useRouter } from "next/navigation";
|
||||||
AccentColor,
|
import { RouterDonasi } from "@/app/lib/router_hipmi/router_donasi";
|
||||||
MainColor,
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
} from "@/app_modules/_global/color/color_pallet";
|
import mqtt_client from "@/util/mqtt_client";
|
||||||
|
import { donasi_getOneStatusInvoiceById } from "../../fun/get/get_one_status_invoice_by_id";
|
||||||
|
|
||||||
export default function Donasi_ProsesTransaksi({
|
export default function Donasi_ProsesTransaksi({
|
||||||
dataInvoice,
|
statusInvoice,
|
||||||
nomorAdmin,
|
nomorAdmin,
|
||||||
}: {
|
}: {
|
||||||
dataInvoice: MODEL_DONASI_INVOICE;
|
statusInvoice: MODEL_DONASI_INVOICE;
|
||||||
nomorAdmin: any;
|
nomorAdmin: any;
|
||||||
}) {
|
}) {
|
||||||
const [invoice, setInvoice] = useState(dataInvoice);
|
const router = useRouter();
|
||||||
|
const [data, setData] = useState(statusInvoice);
|
||||||
const [hotMenu, setHotMenu] = useAtom(gs_donasi_hot_menu);
|
const [hotMenu, setHotMenu] = useAtom(gs_donasi_hot_menu);
|
||||||
const [countD, setCountD] = useState<Date | any>();
|
|
||||||
const interval = useInterval(
|
interface MODAL_DONASI_INVOICE {
|
||||||
() =>
|
invoiceId: string;
|
||||||
reloadData(invoice.id).then((res) =>
|
statusInvoiceId: string;
|
||||||
setInvoice(res as MODEL_DONASI_INVOICE)
|
}
|
||||||
),
|
|
||||||
5000
|
|
||||||
);
|
|
||||||
|
|
||||||
useShallowEffect(() => {
|
useShallowEffect(() => {
|
||||||
interval.start();
|
mqtt_client.subscribe("donasi_invoice");
|
||||||
}, [invoice.id]);
|
|
||||||
|
|
||||||
function reloadData(invoiceId: string) {
|
mqtt_client.on("message", (topic, message) => {
|
||||||
const res = Donasi_getOneInvoiceById(invoiceId);
|
const dataClient: MODAL_DONASI_INVOICE = JSON.parse(message.toString());
|
||||||
return res;
|
if (topic === "donasi_invoice" && dataClient.invoiceId === data.id) {
|
||||||
|
// setData({
|
||||||
|
// ...data,
|
||||||
|
// donasiMaster_StatusInvoiceId: dataClient.statusInvoiceId,
|
||||||
|
// });
|
||||||
|
onLoad();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
async function onLoad() {
|
||||||
|
const loadData = await donasi_getOneStatusInvoiceById({
|
||||||
|
invoiceId: data.id,
|
||||||
|
});
|
||||||
|
setData(loadData as any);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------//
|
if (data.DonasiMaster_StatusInvoice.id === "1") {
|
||||||
|
setHotMenu(2);
|
||||||
// const inter2 = useInterval(
|
router.replace(RouterDonasi.detail_donasi_saya + `${data.id}`, {
|
||||||
// () => cekCD().then((res) => console.log(res)),
|
scroll: false,
|
||||||
// 1000
|
});
|
||||||
// );
|
|
||||||
|
|
||||||
// useShallowEffect(() => {
|
|
||||||
// inter2.start();
|
|
||||||
// }, []);
|
|
||||||
|
|
||||||
async function cekCD() {
|
|
||||||
const date = new Date().getTime();
|
|
||||||
// const jam = date.toTimeString()
|
|
||||||
// const cd = moment(jam).diff((invoice.createdAt), "hour")
|
|
||||||
var a = moment.duration(date).asSeconds();
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (invoice.donasiMaster_StatusInvoiceId === "1") {
|
|
||||||
redirect(RouterDonasi.detail_donasi_saya + `${invoice.id}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
{data.DonasiMaster_StatusInvoice.id === "1" ? (
|
||||||
<Paper
|
<>
|
||||||
style={{
|
<Center h={"50vh"}>
|
||||||
backgroundColor: AccentColor.blue,
|
<Loader color="yellow" />
|
||||||
border: `2px solid ${AccentColor.darkblue}`,
|
</Center>
|
||||||
padding: "15px",
|
</>
|
||||||
cursor: "pointer",
|
) : (
|
||||||
borderRadius: "10px",
|
<Stack>
|
||||||
color: "white",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Stack spacing={"md"}>
|
|
||||||
<Paper
|
|
||||||
style={{
|
|
||||||
backgroundColor: MainColor.darkblue,
|
|
||||||
border: `2px solid ${AccentColor.darkblue}`,
|
|
||||||
padding: "15px",
|
|
||||||
cursor: "pointer",
|
|
||||||
borderRadius: "10px",
|
|
||||||
color: "white",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Stack align="center" justify="center">
|
|
||||||
<Title order={6}>Admin sedang memproses transaksimu</Title>
|
|
||||||
<Paper radius={1000} w={100} h={100}>
|
|
||||||
<Center h={"100%"}>
|
|
||||||
<Loader size={"lg"} color="yellow" variant="bars" />
|
|
||||||
</Center>
|
|
||||||
</Paper>
|
|
||||||
<Title order={6}>Mohon menunggu !</Title>
|
|
||||||
</Stack>
|
|
||||||
</Paper>
|
|
||||||
</Stack>
|
|
||||||
</Paper>
|
|
||||||
<Paper
|
|
||||||
style={{
|
|
||||||
backgroundColor: AccentColor.blue,
|
|
||||||
border: `2px solid ${AccentColor.darkblue}`,
|
|
||||||
padding: "15px",
|
|
||||||
cursor: "pointer",
|
|
||||||
borderRadius: "10px",
|
|
||||||
color: "white",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Paper
|
<Paper
|
||||||
style={{
|
style={{
|
||||||
backgroundColor: AccentColor.darkblue,
|
backgroundColor: AccentColor.blue,
|
||||||
border: `2px solid ${AccentColor.darkblue}`,
|
border: `2px solid ${AccentColor.darkblue}`,
|
||||||
padding: "15px",
|
padding: "15px",
|
||||||
cursor: "pointer",
|
cursor: "pointer",
|
||||||
@@ -132,30 +91,74 @@ export default function Donasi_ProsesTransaksi({
|
|||||||
color: "white",
|
color: "white",
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Group position="center">
|
<Stack spacing={"md"}>
|
||||||
<Stack spacing={0}>
|
<Paper
|
||||||
<Text fz={"xs"} fs={"italic"}>
|
|
||||||
Hubungi admin jika tidak kunjung di proses!
|
|
||||||
</Text>
|
|
||||||
<Text fz={"xs"} fs={"italic"}>
|
|
||||||
Klik pada logo Whatsapp ini.
|
|
||||||
</Text>
|
|
||||||
</Stack>
|
|
||||||
<Link
|
|
||||||
color="white"
|
|
||||||
style={{
|
style={{
|
||||||
color: "black",
|
backgroundColor: MainColor.darkblue,
|
||||||
textDecoration: "none",
|
border: `2px solid ${AccentColor.darkblue}`,
|
||||||
|
padding: "15px",
|
||||||
|
cursor: "pointer",
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
}}
|
}}
|
||||||
target="_blank"
|
|
||||||
href={`https://wa.me/+${nomorAdmin.nomor}?text=Hallo Admin , Saya ada kendala dalam proses transfer donasi!`}
|
|
||||||
>
|
>
|
||||||
<IconBrandWhatsapp size={40} color={Warna.hijau_cerah} />
|
<Stack align="center" justify="center">
|
||||||
</Link>
|
<Title order={6}>Admin sedang memproses transaksimu</Title>
|
||||||
</Group>
|
<Paper radius={1000} w={100} h={100}>
|
||||||
|
<Center h={"100%"}>
|
||||||
|
<Loader size={"lg"} color="yellow" variant="bars" />
|
||||||
|
</Center>
|
||||||
|
</Paper>
|
||||||
|
<Title order={6}>Mohon menunggu !</Title>
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
|
</Stack>
|
||||||
</Paper>
|
</Paper>
|
||||||
</Paper>
|
<Paper
|
||||||
</Stack>
|
style={{
|
||||||
|
backgroundColor: AccentColor.blue,
|
||||||
|
border: `2px solid ${AccentColor.darkblue}`,
|
||||||
|
padding: "15px",
|
||||||
|
cursor: "pointer",
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Paper
|
||||||
|
style={{
|
||||||
|
backgroundColor: AccentColor.darkblue,
|
||||||
|
border: `2px solid ${AccentColor.darkblue}`,
|
||||||
|
padding: "15px",
|
||||||
|
cursor: "pointer",
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Group position="center">
|
||||||
|
<Stack spacing={0}>
|
||||||
|
<Text fz={"xs"} fs={"italic"}>
|
||||||
|
Hubungi admin jika tidak kunjung di proses!
|
||||||
|
</Text>
|
||||||
|
<Text fz={"xs"} fs={"italic"}>
|
||||||
|
Klik pada logo Whatsapp ini.
|
||||||
|
</Text>
|
||||||
|
</Stack>
|
||||||
|
<Link
|
||||||
|
color="white"
|
||||||
|
style={{
|
||||||
|
color: "black",
|
||||||
|
textDecoration: "none",
|
||||||
|
}}
|
||||||
|
target="_blank"
|
||||||
|
href={`https://wa.me/+${nomorAdmin.nomor}?text=Hallo Admin , Saya ada kendala dalam proses transfer donasi!`}
|
||||||
|
>
|
||||||
|
<IconBrandWhatsapp size={40} color={Warna.hijau_cerah} />
|
||||||
|
</Link>
|
||||||
|
</Group>
|
||||||
|
</Paper>
|
||||||
|
</Paper>
|
||||||
|
</Stack>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,21 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
import { AppShell } from "@mantine/core";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export default function LayoutBeritaInvestasi({
|
export default function LayoutBeritaInvestasi({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate header={<ComponentGlobal_HeaderTamplate title="Berita" />}>
|
<UIGlobal_LayoutTamplate
|
||||||
{children}
|
header={<UIGlobal_LayoutHeaderTamplate title="Berita" />}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
>
|
||||||
</>
|
{children}
|
||||||
);
|
</UIGlobal_LayoutTamplate>
|
||||||
}
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
61
src/app_modules/investasi/component/detail/card_status.tsx
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||||
|
import { Paper, Grid, Stack, AspectRatio, Text, Image } from "@mantine/core";
|
||||||
|
import _ from "lodash";
|
||||||
|
|
||||||
|
import { MODEL_Investasi } from "../../model/model_investasi";
|
||||||
|
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
|
export function ComponentInvestasi_CardStatus({
|
||||||
|
data,
|
||||||
|
path,
|
||||||
|
}: {
|
||||||
|
data: MODEL_Investasi;
|
||||||
|
path: string;
|
||||||
|
}) {
|
||||||
|
const router = useRouter();
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Paper
|
||||||
|
onClick={() => router.push(path + `${data.id}`)}
|
||||||
|
style={{
|
||||||
|
padding: "15px",
|
||||||
|
backgroundColor: AccentColor.darkblue,
|
||||||
|
borderRadius: "10px",
|
||||||
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
color: "white",
|
||||||
|
marginBottom: "15px",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Grid>
|
||||||
|
<Grid.Col span={8}>
|
||||||
|
<Text fw={"bold"} lineClamp={1}>
|
||||||
|
{" "}
|
||||||
|
{_.startCase(data.title)}
|
||||||
|
</Text>
|
||||||
|
<Stack spacing={0}>
|
||||||
|
<Text fz={10}>Target Dana:</Text>
|
||||||
|
<Text>
|
||||||
|
Rp.{" "}
|
||||||
|
{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+data.targetDana)}
|
||||||
|
</Text>
|
||||||
|
</Stack>
|
||||||
|
</Grid.Col>
|
||||||
|
|
||||||
|
<Grid.Col span={4}>
|
||||||
|
<AspectRatio ratio={16 / 9}>
|
||||||
|
<Paper radius={"md"}>
|
||||||
|
<Image
|
||||||
|
alt=""
|
||||||
|
src={RouterInvestasi.api_gambar + `${data.imagesId}`}
|
||||||
|
/>
|
||||||
|
</Paper>
|
||||||
|
</AspectRatio>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</Paper>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,159 @@
|
|||||||
|
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||||
|
import { AccentColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import {
|
||||||
|
Stack,
|
||||||
|
Box,
|
||||||
|
AspectRatio,
|
||||||
|
Center,
|
||||||
|
Title,
|
||||||
|
Grid,
|
||||||
|
Paper,
|
||||||
|
Flex,
|
||||||
|
ActionIcon,
|
||||||
|
Image,
|
||||||
|
Text,
|
||||||
|
SimpleGrid,
|
||||||
|
} from "@mantine/core";
|
||||||
|
import _ from "lodash";
|
||||||
|
import { MODEL_Investasi } from "../../model/model_investasi";
|
||||||
|
import { IconBookDownload, IconFileDescription } from "@tabler/icons-react";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
|
export function ComponentInvestasi_DetailDataNonPublish({
|
||||||
|
data,
|
||||||
|
}: {
|
||||||
|
data: MODEL_Investasi;
|
||||||
|
}) {
|
||||||
|
const router = useRouter();
|
||||||
|
const listBox = [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
name: "Prospektus",
|
||||||
|
icon: <IconBookDownload size={70} />,
|
||||||
|
route: RouterInvestasi.detail_prospektus,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
name: "Dokumen",
|
||||||
|
icon: <IconFileDescription size={70} />,
|
||||||
|
route: RouterInvestasi.detail_dokumen,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Stack
|
||||||
|
style={{
|
||||||
|
paddingInline: "15px",
|
||||||
|
paddingBlock: "15px",
|
||||||
|
backgroundColor: AccentColor.darkblue,
|
||||||
|
border: `2px solid ${AccentColor.blue}`,
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<AspectRatio ratio={1 / 1} mx={"sm"} mah={300}>
|
||||||
|
<Image
|
||||||
|
alt=""
|
||||||
|
src={RouterInvestasi.api_gambar + `${data.imagesId}`}
|
||||||
|
radius={"sm"}
|
||||||
|
height={300}
|
||||||
|
width={"100%"}
|
||||||
|
/>
|
||||||
|
</AspectRatio>
|
||||||
|
|
||||||
|
{/* Title dan Persentase */}
|
||||||
|
<Center>
|
||||||
|
<Title order={4} align="center">
|
||||||
|
{_.startCase(data.title)}
|
||||||
|
</Title>
|
||||||
|
</Center>
|
||||||
|
|
||||||
|
{/* Rincian Data */}
|
||||||
|
<Grid p={"md"}>
|
||||||
|
<Grid.Col span={6}>
|
||||||
|
<Stack>
|
||||||
|
<Box>
|
||||||
|
<Text>Dana Dibutuhkan</Text>
|
||||||
|
<Text>
|
||||||
|
Rp.{" "}
|
||||||
|
{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 20,
|
||||||
|
}).format(+data.targetDana)}
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
|
<Box>
|
||||||
|
<Text>Harga Per Lembar</Text>
|
||||||
|
<Text>
|
||||||
|
Rp.{" "}
|
||||||
|
{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+data.hargaLembar)}
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
|
<Box>
|
||||||
|
<Text>Jadwal Pembagian</Text>
|
||||||
|
<Text>{data.MasterPembagianDeviden.name} Bulan </Text>
|
||||||
|
</Box>
|
||||||
|
<Box>
|
||||||
|
<Text>Pencarian Investor</Text>
|
||||||
|
<Text>{data.MasterPencarianInvestor.name} Hari </Text>
|
||||||
|
</Box>
|
||||||
|
</Stack>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={6}>
|
||||||
|
<Stack>
|
||||||
|
<Box>
|
||||||
|
<Text>ROI</Text>
|
||||||
|
<Text>{data.roi} %</Text>
|
||||||
|
</Box>
|
||||||
|
<Box>
|
||||||
|
<Text>Total Lembar</Text>
|
||||||
|
<Text>
|
||||||
|
{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+data.totalLembar)}{" "}
|
||||||
|
lembar
|
||||||
|
</Text>
|
||||||
|
</Box>
|
||||||
|
<Box>
|
||||||
|
<Text>Pembagian Deviden</Text>
|
||||||
|
<Text>{data.MasterPeriodeDeviden.name}</Text>
|
||||||
|
</Box>
|
||||||
|
</Stack>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
{/* List Box */}
|
||||||
|
<SimpleGrid cols={2}>
|
||||||
|
{listBox.map((e) => (
|
||||||
|
<Center key={e.id}>
|
||||||
|
<Paper
|
||||||
|
w={100}
|
||||||
|
style={{
|
||||||
|
padding: "15px",
|
||||||
|
backgroundColor: AccentColor.blue,
|
||||||
|
border: `2px solid ${AccentColor.softblue}`,
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
}}
|
||||||
|
onClick={() => router.push(e.route + `${data.id}`)}
|
||||||
|
>
|
||||||
|
<Stack spacing={0} align="center">
|
||||||
|
<Text fz={12}>{e.name}</Text>
|
||||||
|
<ActionIcon
|
||||||
|
variant="transparent"
|
||||||
|
size={60}
|
||||||
|
style={{ color: "white" }}
|
||||||
|
>
|
||||||
|
{e.icon}
|
||||||
|
</ActionIcon>
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
|
</Center>
|
||||||
|
))}
|
||||||
|
</SimpleGrid>
|
||||||
|
</Stack>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,10 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
|
||||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
|
||||||
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
import { AppShell } from "@mantine/core";
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
export default function InvestasiCreateLayout({
|
export default function InvestasiCreateLayout({
|
||||||
@@ -15,7 +12,7 @@ export default function InvestasiCreateLayout({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<UIGlobal_LayoutTamplate
|
<UIGlobal_LayoutTamplate
|
||||||
header={<UIGlobal_LayoutHeaderTamplate title="Investasi Baru" />}
|
header={<UIGlobal_LayoutHeaderTamplate title="Tambah Investasi" />}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</UIGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
|
|||||||
@@ -21,11 +21,9 @@ import {
|
|||||||
Select,
|
Select,
|
||||||
Stack,
|
Stack,
|
||||||
Text,
|
Text,
|
||||||
TextInput
|
TextInput,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import {
|
import { IconUpload } from "@tabler/icons-react";
|
||||||
IconUpload
|
|
||||||
} from "@tabler/icons-react";
|
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
@@ -33,6 +31,12 @@ import { useState } from "react";
|
|||||||
import toast from "react-simple-toasts";
|
import toast from "react-simple-toasts";
|
||||||
import { funCreateInvestasi } from "../fun/fun_create_investasi";
|
import { funCreateInvestasi } from "../fun/fun_create_investasi";
|
||||||
import { gs_StatusPortoInvestasi, gs_investasiFooter } from "../g_state";
|
import { gs_StatusPortoInvestasi, gs_investasiFooter } from "../g_state";
|
||||||
|
import {
|
||||||
|
AccentColor,
|
||||||
|
MainColor,
|
||||||
|
} from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||||
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
|
|
||||||
export default function InvestasiCreate({
|
export default function InvestasiCreate({
|
||||||
id,
|
id,
|
||||||
@@ -96,9 +100,10 @@ export default function InvestasiCreate({
|
|||||||
setChangeColor(1);
|
setChangeColor(1);
|
||||||
setActiveTab("Review");
|
setActiveTab("Review");
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
router.push(RouterInvestasi.dialog_create);
|
ComponentGlobal_NotifikasiBerhasil(res.message)
|
||||||
|
router.push(RouterInvestasi.portofolio);
|
||||||
} else {
|
} else {
|
||||||
toast(res.message);
|
ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -124,15 +129,35 @@ export default function InvestasiCreate({
|
|||||||
<Box>
|
<Box>
|
||||||
{/* Inputan Create */}
|
{/* Inputan Create */}
|
||||||
<Stack spacing={"sm"} px={"md"}>
|
<Stack spacing={"sm"} px={"md"}>
|
||||||
<AspectRatio ratio={16 / 9}>
|
{img ? (
|
||||||
<Paper radius={"md"} withBorder>
|
<AspectRatio ratio={1 / 1} mah={300}>
|
||||||
{img ? (
|
<Paper
|
||||||
<Image alt="" src={img} />
|
style={{
|
||||||
) : (
|
border: `2px solid ${AccentColor.softblue}`,
|
||||||
<Image alt="" src={"/aset/no-img.png"} />
|
backgroundColor: AccentColor.blue,
|
||||||
)}
|
padding: "10px",
|
||||||
</Paper>
|
borderRadius: "10px",
|
||||||
</AspectRatio>
|
}}
|
||||||
|
>
|
||||||
|
<Image
|
||||||
|
alt="Foto"
|
||||||
|
src={img ? img : "/aset/no-img.png"}
|
||||||
|
maw={200}
|
||||||
|
/>
|
||||||
|
</Paper>
|
||||||
|
</AspectRatio>
|
||||||
|
) : (
|
||||||
|
<Center>
|
||||||
|
<Paper h={300} w={200} withBorder shadow="lg" bg={"gray.1"}>
|
||||||
|
<Stack justify="center" align="center" h={"100%"}>
|
||||||
|
<IconUpload color="gray" />
|
||||||
|
<Text fz={10} fs={"italic"} c={"gray"} fw={"bold"}>
|
||||||
|
Upload Gambar
|
||||||
|
</Text>
|
||||||
|
</Stack>
|
||||||
|
</Paper>
|
||||||
|
</Center>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* Upload Foto */}
|
{/* Upload Foto */}
|
||||||
<Group position="center" mb={"md"}>
|
<Group position="center" mb={"md"}>
|
||||||
@@ -142,7 +167,7 @@ export default function InvestasiCreate({
|
|||||||
const buffer = URL.createObjectURL(
|
const buffer = URL.createObjectURL(
|
||||||
new Blob([new Uint8Array(await files.arrayBuffer())])
|
new Blob([new Uint8Array(await files.arrayBuffer())])
|
||||||
);
|
);
|
||||||
console.log(files.size);
|
// console.log(files.size);
|
||||||
|
|
||||||
if (files.size > maksimalUploadFile) {
|
if (files.size > maksimalUploadFile) {
|
||||||
ComponentGlobal_WarningMaxUpload({});
|
ComponentGlobal_WarningMaxUpload({});
|
||||||
@@ -160,25 +185,44 @@ export default function InvestasiCreate({
|
|||||||
<Button
|
<Button
|
||||||
{...props}
|
{...props}
|
||||||
leftIcon={<IconUpload size={12} />}
|
leftIcon={<IconUpload size={12} />}
|
||||||
compact
|
|
||||||
radius={50}
|
radius={50}
|
||||||
bg={Warna.hijau_muda}
|
bg={MainColor.yellow}
|
||||||
// onClick={() => router.push("/dev/investasi/upload")}
|
color="yellow"
|
||||||
|
c={"black"}
|
||||||
>
|
>
|
||||||
Upload Gambar
|
Upload Gambar
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</FileButton>
|
</FileButton>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
{/* Upload File */}
|
{/* Upload File */}
|
||||||
<Group position="center">
|
<Group position="center">
|
||||||
{!pdf ? (
|
{!pdf ? (
|
||||||
<Paper w={"100%"} bg={"gray.3"} p={"sm"}>
|
<Paper
|
||||||
<Text opacity={"0.3"}>Upload File Prospektus</Text>
|
w={"100%"}
|
||||||
|
style={{
|
||||||
|
border: `2px solid gray`,
|
||||||
|
backgroundColor: "gray.1",
|
||||||
|
padding: "10px",
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "gray"
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text>Upload File Prospektus</Text>
|
||||||
</Paper>
|
</Paper>
|
||||||
) : (
|
) : (
|
||||||
<Paper w={"100%"} bg={"gray.6"} p={"sm"}>
|
<Paper
|
||||||
<Text truncate>{pdf.name}</Text>
|
w={"100%"}
|
||||||
|
style={{
|
||||||
|
border: `2px solid ${AccentColor.softblue}`,
|
||||||
|
backgroundColor: AccentColor.blue,
|
||||||
|
padding: "10px",
|
||||||
|
borderRadius: "10px",
|
||||||
|
color: "white",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Text lineClamp={1}>{pdf.name}</Text>
|
||||||
</Paper>
|
</Paper>
|
||||||
)}
|
)}
|
||||||
{/* {JSON.stringify(filePdf)} */}
|
{/* {JSON.stringify(filePdf)} */}
|
||||||
@@ -205,9 +249,10 @@ export default function InvestasiCreate({
|
|||||||
<Button
|
<Button
|
||||||
leftIcon={<IconUpload size={12} />}
|
leftIcon={<IconUpload size={12} />}
|
||||||
{...props}
|
{...props}
|
||||||
compact
|
|
||||||
radius={"xl"}
|
radius={"xl"}
|
||||||
bg={Warna.hijau_muda}
|
bg={MainColor.yellow}
|
||||||
|
color="yellow"
|
||||||
|
c={"black"}
|
||||||
>
|
>
|
||||||
Upload File
|
Upload File
|
||||||
</Button>
|
</Button>
|
||||||
@@ -215,6 +260,11 @@ export default function InvestasiCreate({
|
|||||||
</FileButton>
|
</FileButton>
|
||||||
</Group>
|
</Group>
|
||||||
<TextInput
|
<TextInput
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
withAsterisk
|
withAsterisk
|
||||||
label="Judul Investasi"
|
label="Judul Investasi"
|
||||||
placeholder="Judul investasi"
|
placeholder="Judul investasi"
|
||||||
@@ -227,32 +277,12 @@ export default function InvestasiCreate({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* <NumberInput
|
|
||||||
withAsterisk
|
|
||||||
type="number"
|
|
||||||
label="Dana Dibutuhkan"
|
|
||||||
placeholder="Masukan nominal dana"
|
|
||||||
onChange={(val: any) => {
|
|
||||||
setValue({
|
|
||||||
...value,
|
|
||||||
targetDana: val,
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<NumberInput
|
|
||||||
label="Harga Per Lembar"
|
|
||||||
type="number"
|
|
||||||
placeholder="Masukan nominal harga"
|
|
||||||
onChange={(val) => {
|
|
||||||
setValue({
|
|
||||||
...value,
|
|
||||||
hargaLembar: +val,
|
|
||||||
});
|
|
||||||
onTotalLembar({ target: value.targetDana, harga: +val });
|
|
||||||
}}
|
|
||||||
/> */}
|
|
||||||
|
|
||||||
<TextInput
|
<TextInput
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
icon={<Text fw={"bold"}>Rp.</Text>}
|
icon={<Text fw={"bold"}>Rp.</Text>}
|
||||||
min={0}
|
min={0}
|
||||||
withAsterisk
|
withAsterisk
|
||||||
@@ -280,6 +310,11 @@ export default function InvestasiCreate({
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<TextInput
|
<TextInput
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
icon={<Text fw={"bold"}>Rp.</Text>}
|
icon={<Text fw={"bold"}>Rp.</Text>}
|
||||||
min={0}
|
min={0}
|
||||||
withAsterisk
|
withAsterisk
|
||||||
@@ -317,7 +352,7 @@ export default function InvestasiCreate({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack spacing={3}>
|
<Stack spacing={3} style={{ color: "white" }}>
|
||||||
<Text fz={"sm"} fw={500}>
|
<Text fz={"sm"} fw={500}>
|
||||||
Total Lembar
|
Total Lembar
|
||||||
</Text>
|
</Text>
|
||||||
@@ -325,12 +360,17 @@ export default function InvestasiCreate({
|
|||||||
<Text>{totalLembar}</Text>
|
<Text>{totalLembar}</Text>
|
||||||
<Divider />
|
<Divider />
|
||||||
</Stack>
|
</Stack>
|
||||||
<Text c={"gray"} fz={10} fs={"italic"}>
|
<Text fz={10} fs={"italic"}>
|
||||||
*Total lembar dihitung dari, Target Dana : Harga Perlembar
|
*Total lembar dihitung dari, Target Dana : Harga Perlembar
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<TextInput
|
<TextInput
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
rightSection={
|
rightSection={
|
||||||
<Text fw={"bold"} c={"gray"}>
|
<Text fw={"bold"} c={"gray"}>
|
||||||
%
|
%
|
||||||
@@ -349,6 +389,11 @@ export default function InvestasiCreate({
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<Select
|
<Select
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
withAsterisk
|
withAsterisk
|
||||||
label="Pencarian Investor"
|
label="Pencarian Investor"
|
||||||
placeholder="Pilih batas waktu"
|
placeholder="Pilih batas waktu"
|
||||||
@@ -364,6 +409,11 @@ export default function InvestasiCreate({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Select
|
<Select
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
withAsterisk
|
withAsterisk
|
||||||
label="Periode Deviden"
|
label="Periode Deviden"
|
||||||
placeholder="Pilih batas waktu"
|
placeholder="Pilih batas waktu"
|
||||||
@@ -376,6 +426,11 @@ export default function InvestasiCreate({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Select
|
<Select
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
withAsterisk
|
withAsterisk
|
||||||
label="Pembagian Deviden"
|
label="Pembagian Deviden"
|
||||||
placeholder="Pilih batas waktu"
|
placeholder="Pilih batas waktu"
|
||||||
@@ -390,10 +445,9 @@ export default function InvestasiCreate({
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
|
||||||
|
|
||||||
<Center my={"lg"}>
|
|
||||||
<Button
|
<Button
|
||||||
|
my={"xl"}
|
||||||
style={{
|
style={{
|
||||||
transition: "0.5s",
|
transition: "0.5s",
|
||||||
}}
|
}}
|
||||||
@@ -412,14 +466,15 @@ export default function InvestasiCreate({
|
|||||||
? true
|
? true
|
||||||
: false
|
: false
|
||||||
}
|
}
|
||||||
w={300}
|
|
||||||
radius={50}
|
radius={50}
|
||||||
bg={Warna.biru}
|
bg={MainColor.yellow}
|
||||||
|
color="yellow"
|
||||||
|
c={"black"}
|
||||||
onClick={() => onSubmit()}
|
onClick={() => onSubmit()}
|
||||||
>
|
>
|
||||||
Simpan
|
Simpan
|
||||||
</Button>
|
</Button>
|
||||||
</Center>
|
</Stack>
|
||||||
</Box>
|
</Box>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,14 +1,10 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { Warna } from "@/app/lib/warna";
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
|
||||||
import { AppShell, Button, Center, Footer } from "@mantine/core";
|
|
||||||
import { IconPencilPlus } from "@tabler/icons-react";
|
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import toast from "react-simple-toasts";
|
|
||||||
|
|
||||||
export default function LayoutCreateBeritaInvestasi({
|
export default function LayoutCreateBeritaInvestasi({
|
||||||
children,
|
children,
|
||||||
@@ -20,16 +16,11 @@ export default function LayoutCreateBeritaInvestasi({
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate
|
<UIGlobal_LayoutTamplate
|
||||||
header={<ComponentGlobal_HeaderTamplate title="Buat Berita" />}
|
header={<UIGlobal_LayoutHeaderTamplate title="Buat Berita" />}
|
||||||
// footer={
|
|
||||||
// <Footer height={70} sx={{ borderStyle: "none" }}>
|
|
||||||
|
|
||||||
// </Footer>
|
|
||||||
// }
|
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,8 +19,16 @@ import { useRouter } from "next/navigation";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import toast from "react-simple-toasts";
|
import toast from "react-simple-toasts";
|
||||||
import funCreateBeritaInvestasi from "../fun/fun_create_berita";
|
import funCreateBeritaInvestasi from "../fun/fun_create_berita";
|
||||||
|
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
import { ComponentGlobal_NotifikasiPeringatan } from "@/app_modules/_global/notif_global/notifikasi_peringatan";
|
||||||
|
import { ComponentGlobal_NotifikasiBerhasil } from "@/app_modules/_global/notif_global/notifikasi_berhasil";
|
||||||
|
import { ComponentGlobal_NotifikasiGagal } from "@/app_modules/_global/notif_global/notifikasi_gagal";
|
||||||
|
|
||||||
export default function CreateBeritaInvestasi({idInves}: {idInves: string}) {
|
export default function CreateBeritaInvestasi({
|
||||||
|
idInves,
|
||||||
|
}: {
|
||||||
|
idInves: string;
|
||||||
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [fl, setFl] = useState<File | null>(null);
|
const [fl, setFl] = useState<File | null>(null);
|
||||||
const [img, setImg] = useState<any | null>();
|
const [img, setImg] = useState<any | null>();
|
||||||
@@ -28,22 +36,22 @@ export default function CreateBeritaInvestasi({idInves}: {idInves: string}) {
|
|||||||
const [value, setValue] = useState({
|
const [value, setValue] = useState({
|
||||||
title: "",
|
title: "",
|
||||||
deskripsi: "",
|
deskripsi: "",
|
||||||
investasiId: idInves
|
investasiId: idInves,
|
||||||
});
|
});
|
||||||
|
|
||||||
async function onCreate() {
|
async function onCreate() {
|
||||||
const body = value;
|
const body = value;
|
||||||
|
|
||||||
if (_.values(body).includes("")) return toast("Lengkapi data");
|
if (_.values(body).includes("")) return toast("Lengkapi data");
|
||||||
if (!fl) return toast("File Kosong");
|
if (!fl) return ComponentGlobal_NotifikasiPeringatan("File Kosong");
|
||||||
|
|
||||||
const fd = new FormData();
|
const fd = new FormData();
|
||||||
fd.append("file", fl);
|
fd.append("file", fl);
|
||||||
|
|
||||||
await funCreateBeritaInvestasi(fd, body as any).then((res) => {
|
await funCreateBeritaInvestasi(fd, body as any).then((res) => {
|
||||||
res.status === 201
|
res.status === 201
|
||||||
? (toast(res.message), router.back())
|
? (ComponentGlobal_NotifikasiBerhasil(res.message), router.back())
|
||||||
: toast(res.message);
|
: ComponentGlobal_NotifikasiGagal(res.message);
|
||||||
});
|
});
|
||||||
|
|
||||||
// router.back();
|
// router.back();
|
||||||
@@ -52,12 +60,18 @@ export default function CreateBeritaInvestasi({idInves}: {idInves: string}) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack px={"xl"}>
|
||||||
<AspectRatio ratio={16 / 9}>
|
<AspectRatio ratio={1 / 1} mx={"sm"} mah={300}>
|
||||||
{img ? (
|
{img ? (
|
||||||
<Image alt="" src={img} />
|
<Image alt="" src={img} radius={"sm"} height={300} width={"100%"} />
|
||||||
) : (
|
) : (
|
||||||
<Image alt="" src={"/aset/no-img.png"} />
|
<Image
|
||||||
|
alt=""
|
||||||
|
src={"/aset/no-img.png"}
|
||||||
|
radius={"sm"}
|
||||||
|
height={300}
|
||||||
|
width={"100%"}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</AspectRatio>
|
</AspectRatio>
|
||||||
<Group position="center" mt={"md"}>
|
<Group position="center" mt={"md"}>
|
||||||
@@ -73,19 +87,25 @@ export default function CreateBeritaInvestasi({idInves}: {idInves: string}) {
|
|||||||
>
|
>
|
||||||
{(props) => (
|
{(props) => (
|
||||||
<Button
|
<Button
|
||||||
compact
|
leftIcon={<IconCamera />}
|
||||||
{...props}
|
{...props}
|
||||||
w={100}
|
|
||||||
radius={50}
|
radius={50}
|
||||||
bg={Warna.hijau_muda}
|
bg={MainColor.yellow}
|
||||||
// onClick={() => router.push("/dev/investasi/upload")}
|
color="yellow"
|
||||||
|
c={"black"}
|
||||||
>
|
>
|
||||||
<IconCamera />
|
Upload
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</FileButton>
|
</FileButton>
|
||||||
</Group>
|
</Group>
|
||||||
<TextInput
|
<TextInput
|
||||||
|
withAsterisk
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
label="Judul berita"
|
label="Judul berita"
|
||||||
onChange={(val) => {
|
onChange={(val) => {
|
||||||
setValue({
|
setValue({
|
||||||
@@ -96,6 +116,12 @@ export default function CreateBeritaInvestasi({idInves}: {idInves: string}) {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<Textarea
|
<Textarea
|
||||||
|
withAsterisk
|
||||||
|
styles={{
|
||||||
|
label: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
}}
|
||||||
label="Deskripsi"
|
label="Deskripsi"
|
||||||
autosize
|
autosize
|
||||||
minRows={2}
|
minRows={2}
|
||||||
@@ -107,19 +133,19 @@ export default function CreateBeritaInvestasi({idInves}: {idInves: string}) {
|
|||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
|
||||||
<Center mt={100}>
|
|
||||||
<Button
|
<Button
|
||||||
w={300}
|
|
||||||
radius={50}
|
radius={50}
|
||||||
bg={Warna.biru}
|
bg={MainColor.yellow}
|
||||||
|
color="yellow"
|
||||||
|
c={"black"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onCreate();
|
onCreate();
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Simpan
|
Simpan
|
||||||
</Button>
|
</Button>
|
||||||
</Center>
|
</Stack>
|
||||||
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ export default function DetailInvestasi({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Box
|
<Stack
|
||||||
style={{
|
style={{
|
||||||
padding: "15px",
|
padding: "15px",
|
||||||
backgroundColor: AccentColor.darkblue,
|
backgroundColor: AccentColor.darkblue,
|
||||||
@@ -161,18 +161,19 @@ export default function DetailInvestasi({
|
|||||||
)}
|
)}
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
<Paper withBorder mb={"md"} p={"xs"}>
|
<AspectRatio ratio={1 / 1} mx={"sm"} mah={300}>
|
||||||
<AspectRatio ratio={1 / 1}>
|
<Image
|
||||||
<Image
|
alt=""
|
||||||
alt=""
|
src={RouterInvestasi.api_gambar + `${investasi.imagesId}`}
|
||||||
src={RouterInvestasi.api_gambar + `${investasi.imagesId}`}
|
radius={"sm"}
|
||||||
/>
|
height={300}
|
||||||
</AspectRatio>
|
width={"100%"}
|
||||||
</Paper>
|
/>
|
||||||
|
</AspectRatio>
|
||||||
|
|
||||||
{/* Title dan Progress */}
|
{/* Title dan Progress */}
|
||||||
<Box mb={"md"}>
|
<Box mb={"md"}>
|
||||||
<Title order={4} mb={"xs"}>
|
<Title order={3} mb={"xs"} align="center">
|
||||||
{investasi.title}
|
{investasi.title}
|
||||||
</Title>
|
</Title>
|
||||||
<Progress
|
<Progress
|
||||||
@@ -328,7 +329,7 @@ export default function DetailInvestasi({
|
|||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
||||||
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
import { AppShell } from "@mantine/core";
|
import { AppShell } from "@mantine/core";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
@@ -12,9 +14,11 @@ export default function LayoutDetailDokumenInvestasi({
|
|||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate header={<ComponentGlobal_HeaderTamplate title="Dokumen" />}>
|
<UIGlobal_LayoutTamplate
|
||||||
|
header={<UIGlobal_LayoutHeaderTamplate title="Dokumen" />}
|
||||||
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import Link from "next/link";
|
|||||||
import { MODEL_Investasi } from "../model/model_investasi";
|
import { MODEL_Investasi } from "../model/model_investasi";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
|
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
|
||||||
|
|
||||||
export default function DetailDokumenInvestasi({
|
export default function DetailDokumenInvestasi({
|
||||||
dataInvestasi,
|
dataInvestasi,
|
||||||
@@ -44,9 +45,7 @@ export default function DetailDokumenInvestasi({
|
|||||||
</Link>
|
</Link>
|
||||||
))
|
))
|
||||||
) : (
|
) : (
|
||||||
<Center>
|
<ComponentGlobal_IsEmptyData/>
|
||||||
<Title order={6}>Tidak Ada File</Title>
|
|
||||||
</Center>
|
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ import { MODEL_Investasi } from "../../model/model_investasi";
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import funGantiStatusInvestasi from "../../fun/fun_ganti_status";
|
import funGantiStatusInvestasi from "../../fun/fun_ganti_status";
|
||||||
|
import { ComponentInvestasi_DetailDataNonPublish } from "../../component/detail/detai_data_non_publish";
|
||||||
|
import { MainColor } from "@/app_modules/_global/color/color_pallet";
|
||||||
|
|
||||||
export default function DetailDraftInvestasi({
|
export default function DetailDraftInvestasi({
|
||||||
dataInvestasi,
|
dataInvestasi,
|
||||||
@@ -40,7 +42,7 @@ export default function DetailDraftInvestasi({
|
|||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [activeTab, setActiveTab] = useAtom(gs_StatusPortoInvestasi);
|
const [activeTab, setActiveTab] = useAtom(gs_StatusPortoInvestasi);
|
||||||
const [investasi, setInvestasi] = useState<MODEL_Investasi>(dataInvestasi);
|
// const [investasi, setInvestasi] = useState<MODEL_Investasi>(dataInvestasi);
|
||||||
|
|
||||||
const listBox = [
|
const listBox = [
|
||||||
{
|
{
|
||||||
@@ -64,7 +66,7 @@ export default function DetailDraftInvestasi({
|
|||||||
];
|
];
|
||||||
|
|
||||||
async function onsubmit() {
|
async function onsubmit() {
|
||||||
await funGantiStatusInvestasi(investasi.id, "2")
|
await funGantiStatusInvestasi(dataInvestasi.id, "2")
|
||||||
.then((res) => res)
|
.then((res) => res)
|
||||||
.then((val) => {
|
.then((val) => {
|
||||||
if (val.status === 200) {
|
if (val.status === 200) {
|
||||||
@@ -79,7 +81,7 @@ export default function DetailDraftInvestasi({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Paper withBorder mb={"md"}>
|
{/* <Paper withBorder mb={"md"}>
|
||||||
<AspectRatio ratio={16 / 9}>
|
<AspectRatio ratio={16 / 9}>
|
||||||
<Image
|
<Image
|
||||||
alt=""
|
alt=""
|
||||||
@@ -88,14 +90,13 @@ export default function DetailDraftInvestasi({
|
|||||||
</AspectRatio>
|
</AspectRatio>
|
||||||
</Paper>
|
</Paper>
|
||||||
|
|
||||||
{/* Title dan Persentase */}
|
|
||||||
<Center>
|
<Center>
|
||||||
<Title order={4} mb={"xs"}>
|
<Title order={4} mb={"xs"}>
|
||||||
{_.capitalize(investasi.title)}
|
{_.capitalize(investasi.title)}
|
||||||
</Title>
|
</Title>
|
||||||
</Center>
|
</Center>
|
||||||
|
|
||||||
{/* Rincian Data */}
|
|
||||||
<Grid p={"md"} mb={"md"}>
|
<Grid p={"md"} mb={"md"}>
|
||||||
<Grid.Col span={6}>
|
<Grid.Col span={6}>
|
||||||
<Stack>
|
<Stack>
|
||||||
@@ -139,19 +140,22 @@ export default function DetailDraftInvestasi({
|
|||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
</Grid>
|
</Grid> */}
|
||||||
|
|
||||||
<Center>
|
<Stack mb={"lg"}>
|
||||||
<Button
|
<ComponentInvestasi_DetailDataNonPublish data={dataInvestasi} />
|
||||||
w={300}
|
<Stack>
|
||||||
radius={50}
|
<Button
|
||||||
bg={"yellow.7"}
|
radius={50}
|
||||||
color="yellow"
|
bg={MainColor.yellow}
|
||||||
onClick={() => onsubmit()}
|
color="yellow"
|
||||||
>
|
c={"black"}
|
||||||
Ajukan Review
|
onClick={() => onsubmit()}
|
||||||
</Button>
|
>
|
||||||
</Center>
|
Ajukan Review
|
||||||
|
</Button>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -1,31 +1,71 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
|
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||||
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
import AppComponentGlobal_LayoutTamplate from "@/app_modules/_global/component_layout_tamplate";
|
||||||
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
import ComponentGlobal_HeaderTamplate from "@/app_modules/_global/header_tamplate";
|
||||||
import { AppShell } from "@mantine/core";
|
import UIGlobal_Drawer from "@/app_modules/_global/ui/ui_drawer";
|
||||||
import { IconEdit } from "@tabler/icons-react";
|
import UIGlobal_LayoutHeaderTamplate from "@/app_modules/_global/ui/ui_header_tamplate";
|
||||||
import React from "react";
|
import UIGlobal_LayoutTamplate from "@/app_modules/_global/ui/ui_layout_tamplate";
|
||||||
|
import { ActionIcon, AppShell } from "@mantine/core";
|
||||||
|
import { IconDotsVertical, IconEdit, IconFilePencil } from "@tabler/icons-react";
|
||||||
|
import React, { useState } from "react";
|
||||||
|
|
||||||
export default function LayoutDetailDraftInvestasi({
|
export default function LayoutDetailDraftInvestasi({
|
||||||
children,
|
children,
|
||||||
id
|
id,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
id: string
|
id: string;
|
||||||
}) {
|
}) {
|
||||||
|
const [openDrawer, setOpenDrawer] = useState(false);
|
||||||
|
const listPage = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
name: "Edit Investasi",
|
||||||
|
icon: <IconEdit />,
|
||||||
|
path: RouterInvestasi.edit_intro + id,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
name: "Edit Prospektus",
|
||||||
|
icon: <IconFilePencil />,
|
||||||
|
path: RouterInvestasi.upload_prospektus + id,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "3",
|
||||||
|
name: "Edit Dokumen",
|
||||||
|
icon: <IconFilePencil />,
|
||||||
|
path: RouterInvestasi.edit_dokumen + id,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppComponentGlobal_LayoutTamplate
|
<UIGlobal_LayoutTamplate
|
||||||
header={
|
header={
|
||||||
<ComponentGlobal_HeaderTamplate
|
<UIGlobal_LayoutHeaderTamplate
|
||||||
title="Detail Draft"
|
title="Detail Draft"
|
||||||
icon={<IconEdit />}
|
// icon={<IconEdit />}
|
||||||
route2={`/dev/investasi/edit/${id}`}
|
// route2={`/dev/investasi/edit/${id}`}
|
||||||
|
customButtonRight={
|
||||||
|
<ActionIcon
|
||||||
|
variant="transparent"
|
||||||
|
onClick={() => setOpenDrawer(true)}
|
||||||
|
>
|
||||||
|
<IconDotsVertical color="white" />
|
||||||
|
</ActionIcon>
|
||||||
|
}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppComponentGlobal_LayoutTamplate>
|
</UIGlobal_LayoutTamplate>
|
||||||
|
|
||||||
|
<UIGlobal_Drawer
|
||||||
|
opened={openDrawer}
|
||||||
|
close={() => setOpenDrawer(false)}
|
||||||
|
component={listPage}
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||