Fitur transaksi
# feat: - Load data sesuai dengan status - Countdown setelah pembelian ### issue: menyambungkan ke xendit
This commit is contained in:
@@ -1,9 +1,32 @@
|
|||||||
import { TransaksiInvestasi } from "@/app_modules/investasi";
|
import { TransaksiInvestasi } from "@/app_modules/investasi";
|
||||||
|
import getListAllTransaksiById_Investasi from "@/app_modules/investasi/fun/get_list_all_transaksi_by_id";
|
||||||
|
import getMaster_StatusTransaksiInvestasi from "@/app_modules/investasi/fun/master/get_status_transaksi";
|
||||||
|
|
||||||
|
import fs from "fs";
|
||||||
|
import yaml from "yaml";
|
||||||
|
import { unsealData } from "iron-session";
|
||||||
|
import { cookies } from "next/headers";
|
||||||
|
import funCountDown from "@/app_modules/investasi/fun/fun_countdown_investasi";
|
||||||
|
import funCekSisaWaktuTransaksiInvestasi from "@/app_modules/investasi/fun/fun_cek_sisa_waktu";
|
||||||
|
const config = yaml.parse(fs.readFileSync("config.yaml").toString());
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
|
const c = cookies().get("ssn");
|
||||||
|
const tkn = JSON.parse(
|
||||||
|
await unsealData(c?.value as string, {
|
||||||
|
password: config.server.password,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
const userId = tkn.id;
|
||||||
|
const statusTransaksi = await getMaster_StatusTransaksiInvestasi();
|
||||||
|
const listTransaksi = await getListAllTransaksiById_Investasi(userId);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<TransaksiInvestasi />
|
<TransaksiInvestasi
|
||||||
|
statusTransaksi={statusTransaksi as any}
|
||||||
|
listTransaksi={listTransaksi as any}
|
||||||
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
14
src/app/dev/investasi/status_transaksi/gagal/[id]/page.tsx
Normal file
14
src/app/dev/investasi/status_transaksi/gagal/[id]/page.tsx
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import { StatusTransaksiInvestasi_Gagal } from "@/app_modules/investasi";
|
||||||
|
import getTransaksiByIdInvestasi from "@/app_modules/investasi/fun/get_transaksi_investasi";
|
||||||
|
|
||||||
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
|
// console.log(params.id)
|
||||||
|
const dataTransaksi = await getTransaksiByIdInvestasi(params.id);
|
||||||
|
// console.log(dataTransaksi);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<StatusTransaksiInvestasi_Gagal dataTransaksi={dataTransaksi as any} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
import { StatusTransaksiInvestasi_Gagal } from "@/app_modules/investasi";
|
|
||||||
|
|
||||||
export default async function Page() {
|
|
||||||
return <>
|
|
||||||
<StatusTransaksiInvestasi_Gagal/>
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
@@ -1,11 +1,17 @@
|
|||||||
import { TransferInvestasi } from "@/app_modules/investasi";
|
import { TransferInvestasi } from "@/app_modules/investasi";
|
||||||
|
import funCountDown from "@/app_modules/investasi/fun/fun_countdown_investasi";
|
||||||
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
import getOneInvestasiById from "@/app_modules/investasi/fun/get_one_investasi_by_id";
|
||||||
import getTransaksiInvestasi from "@/app_modules/investasi/fun/get_transaksi_investasi";
|
import getTransaksiByIdInvestasi from "@/app_modules/investasi/fun/get_transaksi_investasi";
|
||||||
|
|
||||||
export default async function Page({ params }: { params: { id: string } }) {
|
export default async function Page({ params }: { params: { id: string } }) {
|
||||||
const dataTransaksi = await getTransaksiInvestasi(params.id);
|
const dataTransaksi = await getTransaksiByIdInvestasi(params.id);
|
||||||
|
// const cd = await funCountDown(params.id)
|
||||||
|
// console.log(dataTransaksi)
|
||||||
|
// const cd = await funCountDown("" + dataTransaksi?.id);
|
||||||
|
|
||||||
return <>
|
return (
|
||||||
<TransferInvestasi dataTransaksi={dataTransaksi as any}/>
|
<>
|
||||||
</>;
|
<TransferInvestasi dataTransaksi={dataTransaksi as any} />
|
||||||
|
</>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export const RouterInvestasi = {
|
|||||||
// proses beli saham
|
// proses beli saham
|
||||||
proses_investasi: "/dev/investasi/proses_investasi/",
|
proses_investasi: "/dev/investasi/proses_investasi/",
|
||||||
status_transaksi: "/dev/investasi/status_transaksi/berhasil",
|
status_transaksi: "/dev/investasi/status_transaksi/berhasil",
|
||||||
status_transaksi_gagal: "/dev/investasi/status_transaksi/gagal",
|
status_transaksi_gagal: "/dev/investasi/status_transaksi/gagal/",
|
||||||
metode_transfer: "/dev/investasi/metode_transfer/",
|
metode_transfer: "/dev/investasi/metode_transfer/",
|
||||||
|
|
||||||
// edit //
|
// edit //
|
||||||
|
|||||||
33
src/app_modules/investasi/fun/fun_cek_sisa_waktu.ts
Normal file
33
src/app_modules/investasi/fun/fun_cek_sisa_waktu.ts
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
"use server";
|
||||||
|
|
||||||
|
import moment from "moment";
|
||||||
|
import { MODEL_Transaksi_Investasi } from "../model/model_investasi";
|
||||||
|
import funGantiStatusTransaksi_Investasi from "./fun_ganti_status_transaksi";
|
||||||
|
|
||||||
|
export default async function funCekSisaWaktuTransaksiInvestasi(
|
||||||
|
data: MODEL_Transaksi_Investasi[]
|
||||||
|
) {
|
||||||
|
const listData = data;
|
||||||
|
|
||||||
|
|
||||||
|
for (let e of listData) {
|
||||||
|
cekWaktu(e)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function cekWaktu(data: MODEL_Transaksi_Investasi) {
|
||||||
|
// console.log(data)
|
||||||
|
const selesai = moment(data.createdAt).add(1, "days").format();
|
||||||
|
// let durasi = moment.duration(moment(selesai).diff(new Date()));
|
||||||
|
const skrng = moment(new Date());
|
||||||
|
const sisaWaktu = moment(selesai).diff(skrng);
|
||||||
|
|
||||||
|
|
||||||
|
if (sisaWaktu <= 0) {
|
||||||
|
await funGantiStatusTransaksi_Investasi(data.id, "4")
|
||||||
|
.then((res) => {
|
||||||
|
// console.log(res.data)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
30
src/app_modules/investasi/fun/fun_countdown_investasi.ts
Normal file
30
src/app_modules/investasi/fun/fun_countdown_investasi.ts
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
"use server";
|
||||||
|
|
||||||
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import moment from "moment";
|
||||||
|
import funGantiStatusTransaksi_Investasi from "./fun_ganti_status_transaksi";
|
||||||
|
import { MODEL_Transaksi_Investasi } from "../model/model_investasi";
|
||||||
|
|
||||||
|
export default async function funCountDown(data: MODEL_Transaksi_Investasi) {
|
||||||
|
// const res = await prisma.transaksiInvestasi.findMany({
|
||||||
|
// where: {
|
||||||
|
// id: data.id,
|
||||||
|
// },
|
||||||
|
// });
|
||||||
|
|
||||||
|
// if (!res) return { status: 400 };
|
||||||
|
|
||||||
|
// const selesai = moment(data.createdAt).add(1, "days").format();
|
||||||
|
// let durasi = moment.duration(moment(selesai).diff(new Date()));
|
||||||
|
// const timer = setInterval(() => {
|
||||||
|
// durasi = moment.duration(+durasi - 1000, "milliseconds");
|
||||||
|
// // console.log(d.days(), "=", d.hours(), d.minutes(), d.seconds());
|
||||||
|
// if (durasi.hours() <= 0 && durasi.minutes() <= 0 && durasi.seconds() <= 0) {
|
||||||
|
// funGantiStatusTransaksi_Investasi(data.id, "4");
|
||||||
|
// clearInterval(timer);
|
||||||
|
// return {
|
||||||
|
// status: 200,
|
||||||
|
// };
|
||||||
|
// }
|
||||||
|
// }, 1000);
|
||||||
|
}
|
||||||
38
src/app_modules/investasi/fun/fun_ganti_status_transaksi.ts
Normal file
38
src/app_modules/investasi/fun/fun_ganti_status_transaksi.ts
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
"use server";
|
||||||
|
|
||||||
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||||
|
import { revalidatePath } from "next/cache";
|
||||||
|
|
||||||
|
export default async function funGantiStatusTransaksi_Investasi(
|
||||||
|
transaksiId: string,
|
||||||
|
status: string
|
||||||
|
) {
|
||||||
|
// console.log(transaksiId, "hehe", status)
|
||||||
|
const data = await prisma.transaksiInvestasi.update({
|
||||||
|
where: {
|
||||||
|
id: transaksiId,
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
masterStatusTransaksiInvestasiId: status,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
namaBank: true,
|
||||||
|
totalTransfer: true,
|
||||||
|
Investasi: true,
|
||||||
|
MasterStatusTransaksiInvestasi: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (!data) return { status: 400, message: "Status Gagal Diubah" };
|
||||||
|
|
||||||
|
revalidatePath(RouterInvestasi.main_transaksi)
|
||||||
|
return {
|
||||||
|
data: data,
|
||||||
|
status: 200,
|
||||||
|
message: "Status Diubah",
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
"use server";
|
||||||
|
|
||||||
|
import prisma from "@/app/lib/prisma";
|
||||||
|
import moment from "moment";
|
||||||
|
import { MODEL_Transaksi_Investasi } from "../model/model_investasi";
|
||||||
|
import funGantiStatusTransaksi_Investasi from "./fun_ganti_status_transaksi";
|
||||||
|
|
||||||
|
export default async function getListAllTransaksiById_Investasi(
|
||||||
|
userId: string
|
||||||
|
) {
|
||||||
|
const data = await prisma.transaksiInvestasi.findMany({
|
||||||
|
orderBy: {
|
||||||
|
updatedAt: "desc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
authorId: userId,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
namaBank: true,
|
||||||
|
nomorRekening: true,
|
||||||
|
totalTransfer: true,
|
||||||
|
lembarTerbeli: true,
|
||||||
|
active: true,
|
||||||
|
createdAt: true,
|
||||||
|
updatedAt: true,
|
||||||
|
authorId: true,
|
||||||
|
masterStatusTransaksiInvestasiId: true,
|
||||||
|
MasterStatusTransaksiInvestasi: true,
|
||||||
|
investasiId: true,
|
||||||
|
Investasi: true,
|
||||||
|
// Author:true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
for (let e of data) {
|
||||||
|
cekWaktu(e as any)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function cekWaktu(data: MODEL_Transaksi_Investasi) {
|
||||||
|
// console.log(data)
|
||||||
|
const selesai = moment(data.createdAt).add(1, "days").format();
|
||||||
|
const skrng = moment(new Date());
|
||||||
|
const sisaWaktu = moment(selesai).diff(skrng);
|
||||||
|
|
||||||
|
if (sisaWaktu <= 0) {
|
||||||
|
await funGantiStatusTransaksi_Investasi(data.id, "4")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const dataBaru = await prisma.transaksiInvestasi.findMany({
|
||||||
|
orderBy: {
|
||||||
|
createdAt: "desc",
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
authorId: userId,
|
||||||
|
},
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
namaBank: true,
|
||||||
|
nomorRekening: true,
|
||||||
|
totalTransfer: true,
|
||||||
|
lembarTerbeli: true,
|
||||||
|
active: true,
|
||||||
|
createdAt: true,
|
||||||
|
updatedAt: true,
|
||||||
|
authorId: true,
|
||||||
|
masterStatusTransaksiInvestasiId: true,
|
||||||
|
MasterStatusTransaksiInvestasi: true,
|
||||||
|
investasiId: true,
|
||||||
|
Investasi: true,
|
||||||
|
// Author:true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return dataBaru
|
||||||
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import prisma from "@/app/lib/prisma"
|
import prisma from "@/app/lib/prisma"
|
||||||
|
|
||||||
export default async function getTransaksiInvestasi(id: string) {
|
export default async function getTransaksiByIdInvestasi(id: string) {
|
||||||
const data = await prisma.transaksiInvestasi.findUnique({
|
const data = await prisma.transaksiInvestasi.findUnique({
|
||||||
where: {
|
where: {
|
||||||
id: id
|
id: id
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
"use server"
|
||||||
|
|
||||||
|
import prisma from "@/app/lib/prisma"
|
||||||
|
|
||||||
|
export default async function getMaster_StatusTransaksiInvestasi() {
|
||||||
|
const data = await prisma.masterStatusTransaksiInvestasi.findMany()
|
||||||
|
return data
|
||||||
|
}
|
||||||
@@ -55,7 +55,7 @@ import DetailPublishInvestasi from "./detail_portofolio/publish/page";
|
|||||||
import LayoutDetailPublishInvestasi from "./detail_portofolio/publish/layout";
|
import LayoutDetailPublishInvestasi from "./detail_portofolio/publish/layout";
|
||||||
import DetailRejectInvestasi from "./detail_portofolio/reject/page";
|
import DetailRejectInvestasi from "./detail_portofolio/reject/page";
|
||||||
import LayoutDetailRejectInvestasi from "./detail_portofolio/reject/layout";
|
import LayoutDetailRejectInvestasi from "./detail_portofolio/reject/layout";
|
||||||
import TransaksiInvestasi from "./transaksi/page";
|
import TransaksiInvestasi from "./transaksi/view";
|
||||||
import LayoutTransaksiInvestasi from "./transaksi/layout";
|
import LayoutTransaksiInvestasi from "./transaksi/layout";
|
||||||
import StatusTransaksiInvestasi_Gagal from "./status_transaksi/gagal/view";
|
import StatusTransaksiInvestasi_Gagal from "./status_transaksi/gagal/view";
|
||||||
import LayoutStatusTransaksiInvestasi_Gagal from "./status_transaksi/gagal/layout";
|
import LayoutStatusTransaksiInvestasi_Gagal from "./status_transaksi/gagal/layout";
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ export default function MetodeTransferInvestasi({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<pre>{JSON.stringify(transferValue, null, 2)}</pre>
|
{/* <pre>{JSON.stringify(transferValue, null, 2)}</pre> */}
|
||||||
{/* Box judul */}
|
{/* Box judul */}
|
||||||
<Paper bg={"gray"} p={"xs"} shadow="lg" mb={"md"}>
|
<Paper bg={"gray"} p={"xs"} shadow="lg" mb={"md"}>
|
||||||
<Title order={5}>{investasi.title}</Title>
|
<Title order={5}>{investasi.title}</Title>
|
||||||
|
|||||||
@@ -6,16 +6,16 @@ export interface MODEL_Investasi {
|
|||||||
targetDana: string;
|
targetDana: string;
|
||||||
hargaLembar: string;
|
hargaLembar: string;
|
||||||
totalLembar: string;
|
totalLembar: string;
|
||||||
sisaLembar: string,
|
sisaLembar: string;
|
||||||
lembarTerbeli: string
|
lembarTerbeli: string;
|
||||||
roi: string;
|
roi: string;
|
||||||
active: true;
|
active: true;
|
||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
updatedAt: Date;
|
updatedAt: Date;
|
||||||
authorId: string;
|
authorId: string;
|
||||||
imagesId: string;
|
imagesId: string;
|
||||||
catatan: string
|
catatan: string;
|
||||||
progress: string,
|
progress: string;
|
||||||
MasterStatusInvestasi: MODEL_Status_investasi;
|
MasterStatusInvestasi: MODEL_Status_investasi;
|
||||||
BeritaInvestasi: Model_Berita_Investasi[];
|
BeritaInvestasi: Model_Berita_Investasi[];
|
||||||
DokumenInvestasi: Model_Dokumen_Investasi[];
|
DokumenInvestasi: Model_Dokumen_Investasi[];
|
||||||
@@ -23,19 +23,25 @@ export interface MODEL_Investasi {
|
|||||||
MasterPembagianDeviden: Model_All_Master;
|
MasterPembagianDeviden: Model_All_Master;
|
||||||
MasterPencarianInvestor: Model_All_Master;
|
MasterPencarianInvestor: Model_All_Master;
|
||||||
MasterPeriodeDeviden: Model_All_Master;
|
MasterPeriodeDeviden: Model_All_Master;
|
||||||
|
masterPeriodeDevidenId: string;
|
||||||
|
masterPembagianDevidenId: string;
|
||||||
|
masterPencarianInvestorId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MODEL_Transaksi_Investasi {
|
export interface MODEL_Transaksi_Investasi {
|
||||||
id: string;
|
id: string;
|
||||||
lembarTerbeli: string,
|
namaBank: string;
|
||||||
totalTransfer: string,
|
nomorRekening: string;
|
||||||
namaBank: string,
|
totalTransfer: string;
|
||||||
nomorRekening: string
|
lembarTerbeli: string;
|
||||||
active: true;
|
active: boolean;
|
||||||
createdAt: Date;
|
createdAt: Date;
|
||||||
updatedAt: Date;
|
updatedAt: Date;
|
||||||
Author: MODEL_User_profile,
|
investasiId: string;
|
||||||
Investasi: MODEL_Investasi
|
authorId: string;
|
||||||
|
masterStatusTransaksiInvestasiId: string;
|
||||||
|
MasterStatusTransaksiInvestasi: Model_Status_Transaksi_Investasi;
|
||||||
|
Investasi: MODEL_Investasi;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MODEL_Status_investasi {
|
export interface MODEL_Status_investasi {
|
||||||
@@ -61,29 +67,38 @@ export interface Model_Berita_Investasi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface Model_Prospektus_Investasi {
|
export interface Model_Prospektus_Investasi {
|
||||||
id: string
|
id: string;
|
||||||
url: string
|
url: string;
|
||||||
active: boolean;
|
active: boolean;
|
||||||
createdAt: Date
|
createdAt: Date;
|
||||||
updatedAt: Date
|
updatedAt: Date;
|
||||||
investasiId: string
|
investasiId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Model_Dokumen_Investasi {
|
export interface Model_Dokumen_Investasi {
|
||||||
id: string
|
id: string;
|
||||||
title: string
|
title: string;
|
||||||
url: string
|
url: string;
|
||||||
active: boolean;
|
active: boolean;
|
||||||
createdAt: Date
|
createdAt: Date;
|
||||||
updatedAt: Date
|
updatedAt: Date;
|
||||||
investasiId: string
|
investasiId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Model_Nama_Bank {
|
export interface Model_Nama_Bank {
|
||||||
id: string,
|
id: string;
|
||||||
name: string,
|
name: string;
|
||||||
norek: string,
|
norek: string;
|
||||||
active: boolean,
|
active: boolean;
|
||||||
createdAt: Date,
|
createdAt: Date;
|
||||||
updatedAt: Date
|
updatedAt: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Model_Status_Transaksi_Investasi {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
color: string;
|
||||||
|
active: boolean;
|
||||||
|
createdAt: Date;
|
||||||
|
updatedAt: Date;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ export default function ProsesInvestasi({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<pre>{JSON.stringify(transferValue, null, 2)}</pre>
|
{/* <pre>{JSON.stringify(transferValue, null, 2)}</pre> */}
|
||||||
<Box px={"md"}>
|
<Box px={"md"}>
|
||||||
{/* Sisa Lembar Saham */}
|
{/* Sisa Lembar Saham */}
|
||||||
<Group position="apart" mb={"md"}>
|
<Group position="apart" mb={"md"}>
|
||||||
|
|||||||
@@ -1,57 +1,67 @@
|
|||||||
"use client"
|
"use client";
|
||||||
|
|
||||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||||
import { Warna } from "@/app/lib/warna";
|
import { Warna } from "@/app/lib/warna";
|
||||||
import { AppShell, Header, Group, CloseButton, ActionIcon, Footer, Center, Button, Text } from "@mantine/core";
|
import {
|
||||||
|
AppShell,
|
||||||
|
Header,
|
||||||
|
Group,
|
||||||
|
CloseButton,
|
||||||
|
ActionIcon,
|
||||||
|
Footer,
|
||||||
|
Center,
|
||||||
|
Button,
|
||||||
|
Text,
|
||||||
|
} from "@mantine/core";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { gs_investasiFooter } from "../../g_state";
|
import { gs_investasiFooter } from "../../g_state";
|
||||||
|
|
||||||
export default function LayoutStatusTransaksiInvestasi_Gagal( {
|
export default function LayoutStatusTransaksiInvestasi_Gagal({
|
||||||
children,
|
children,
|
||||||
}: {
|
}: {
|
||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [hotMenu, setHotMenu] = useAtom(gs_investasiFooter);
|
const [hotMenu, setHotMenu] = useAtom(gs_investasiFooter);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<AppShell
|
<AppShell
|
||||||
header={
|
header={
|
||||||
<Header height={50}>
|
<Header height={50}>
|
||||||
<Group position="apart" align="center" h={50} px={"md"}>
|
<Group position="apart" align="center" h={50} px={"md"}>
|
||||||
<CloseButton
|
<CloseButton
|
||||||
size={"md"}
|
size={"md"}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
router.push(RouterInvestasi.main_transaksi);
|
router.push(RouterInvestasi.main_transaksi);
|
||||||
setHotMenu(3);
|
setHotMenu(3);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Text>Status Transaksi</Text>
|
<Text>Status Transaksi</Text>
|
||||||
<ActionIcon variant="transparent" disabled></ActionIcon>
|
<ActionIcon variant="transparent" disabled></ActionIcon>
|
||||||
</Group>
|
</Group>
|
||||||
</Header>
|
</Header>
|
||||||
}
|
}
|
||||||
footer={
|
footer={
|
||||||
<Footer height={70} sx={{ borderStyle: "none" }}>
|
<Footer height={70} sx={{ borderStyle: "none" }}>
|
||||||
<Center>
|
<Center>
|
||||||
<Button
|
<Button
|
||||||
w={300}
|
px={"xl"}
|
||||||
radius={50}
|
radius={50}
|
||||||
bg={Warna.biru}
|
bg={Warna.biru}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
router.push(RouterInvestasi.main_transaksi), setHotMenu(3);
|
router.push(RouterInvestasi.main_transaksi), setHotMenu(3);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Kembali Ke Transaksi
|
Kembali Ke Transaksi
|
||||||
</Button>
|
</Button>
|
||||||
</Center>
|
</Center>
|
||||||
</Footer>
|
</Footer>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</AppShell>
|
</AppShell>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,27 @@
|
|||||||
"use client"
|
"use client";
|
||||||
|
|
||||||
import { Paper, Stack, Center, Flex, Title, Divider, Group, Text } from "@mantine/core";
|
import {
|
||||||
|
Paper,
|
||||||
|
Stack,
|
||||||
|
Center,
|
||||||
|
Flex,
|
||||||
|
Title,
|
||||||
|
Divider,
|
||||||
|
Group,
|
||||||
|
Text,
|
||||||
|
} from "@mantine/core";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
import { IconAlertHexagon } from "@tabler/icons-react";
|
import { IconAlertHexagon } from "@tabler/icons-react";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import { MODEL_Transaksi_Investasi } from "../../model/model_investasi";
|
||||||
|
|
||||||
export default function StatusTransaksiInvestasi_Gagal(){
|
export default function StatusTransaksiInvestasi_Gagal({
|
||||||
const [tgl, setTgl] = useState<any | Date>(null);
|
dataTransaksi,
|
||||||
|
}: {
|
||||||
useShallowEffect(() => {
|
dataTransaksi: MODEL_Transaksi_Investasi;
|
||||||
onDate();
|
}) {
|
||||||
}, []);
|
const [transaksi, setTransaksi] = useState(dataTransaksi)
|
||||||
|
|
||||||
async function onDate() {
|
|
||||||
const d = Date.now();
|
|
||||||
setTgl(moment(d).format("LLL"));
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -26,37 +31,39 @@ export default function StatusTransaksiInvestasi_Gagal(){
|
|||||||
<Stack>
|
<Stack>
|
||||||
<Flex direction={"column"} align={"center"}>
|
<Flex direction={"column"} align={"center"}>
|
||||||
<Title order={5}>Transaksi Gagal</Title>
|
<Title order={5}>Transaksi Gagal</Title>
|
||||||
<Text fz={10}>{tgl}</Text>
|
<Text fz={10}>{moment(transaksi.createdAt).format('lll')}</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
<Center>
|
<Center>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Center>
|
<Center>
|
||||||
<IconAlertHexagon size={100} color="red"/>
|
<IconAlertHexagon size={100} color="red" />
|
||||||
</Center>
|
</Center>
|
||||||
<Text fw={"bold"} >
|
{/* <Text fw={"bold"}>Rp. {transaksi.totalTransfer}</Text> */}
|
||||||
Rp. 300.000
|
</Stack>
|
||||||
</Text>
|
|
||||||
</Stack>
|
|
||||||
</Center>
|
</Center>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Center>
|
</Center>
|
||||||
<Stack px={"md"}>
|
<Stack px={"md"}>
|
||||||
<Divider color="dark.1" />
|
<Divider color="dark.1" />
|
||||||
<Group position="apart">
|
<Group position="apart">
|
||||||
<Text>Penerima</Text>
|
<Text>Nama Investasi</Text>
|
||||||
<Text fw={"bold"}>Nama Penerima</Text>
|
<Text fw={"bold"}>{transaksi.Investasi.title}</Text>
|
||||||
</Group>
|
</Group>
|
||||||
<Group position="apart">
|
<Group position="apart">
|
||||||
<Text>Bank Penerima</Text>
|
<Text>Bank Tujuan</Text>
|
||||||
<Text fw={"bold"}>Nama Bank(BNI, BSI, dll)</Text>
|
<Text fw={"bold"}>{transaksi.namaBank}</Text>
|
||||||
</Group>
|
</Group>
|
||||||
<Group position="apart">
|
<Group position="apart">
|
||||||
<Text>Nomor Rekening</Text>
|
<Text>Jumlah Transfer</Text>
|
||||||
<Text fw={"bold"}>0000000000000</Text>
|
<Text fw={"bold"}>Rp. {transaksi.totalTransfer}</Text>
|
||||||
|
</Group>
|
||||||
|
<Group position="apart">
|
||||||
|
<Text>Jumlah Lembar</Text>
|
||||||
|
<Text fw={"bold"}>{transaksi.lembarTerbeli}</Text>
|
||||||
</Group>
|
</Group>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Paper>
|
</Paper>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,127 +0,0 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
|
||||||
import { Badge, Group, Paper, Stack, Text, Title } from "@mantine/core";
|
|
||||||
import { useRouter } from "next/navigation";
|
|
||||||
import toast from "react-simple-toasts";
|
|
||||||
|
|
||||||
export default function TransaksiInvestasi() {
|
|
||||||
const router = useRouter();
|
|
||||||
const listStatusTransaksi = [
|
|
||||||
{ id: 1, name: "Berhasil" },
|
|
||||||
{ id: 2, name: "Menunggu" },
|
|
||||||
{ id: 3, name: "Proses" },
|
|
||||||
{ id: 4, name: "Batal" },
|
|
||||||
];
|
|
||||||
|
|
||||||
const dataDummy = [
|
|
||||||
{
|
|
||||||
id: 1,
|
|
||||||
name: "Judul Investasi",
|
|
||||||
status: { id: 1, name: "Berhasil" },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 2,
|
|
||||||
name: "Judul Investasi",
|
|
||||||
status: { id: 3, name: "Proses" },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 3,
|
|
||||||
name: "Judul Investasi",
|
|
||||||
status: { id: 2, name: "Menunggu" },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
name: "Judul Investasi",
|
|
||||||
status: { id: 4, name: "Batal" },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 5,
|
|
||||||
name: "Judul Investasi",
|
|
||||||
status: { id: 1, name: "Berhasil" },
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
async function onKlik(id: any) {
|
|
||||||
if (id === 1) {
|
|
||||||
return router.push(RouterInvestasi.status_transaksi);
|
|
||||||
} else {
|
|
||||||
if (id === 2) {
|
|
||||||
return router.push(RouterInvestasi.transfer);
|
|
||||||
} else {
|
|
||||||
if (id === 3) {
|
|
||||||
return router.push(RouterInvestasi.dialog_transaksi)
|
|
||||||
} else {
|
|
||||||
return router.push(RouterInvestasi.status_transaksi_gagal)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Stack>
|
|
||||||
{dataDummy.map((e) => (
|
|
||||||
<Paper
|
|
||||||
key={e.id}
|
|
||||||
p="xs"
|
|
||||||
bg={"gray"}
|
|
||||||
onClick={() => onKlik(e.status.id)}
|
|
||||||
>
|
|
||||||
<Group position="apart">
|
|
||||||
<Title order={5}>{e.name}</Title>
|
|
||||||
<Title order={5}>Rp. 100.000</Title>
|
|
||||||
</Group>
|
|
||||||
<Group position="apart">
|
|
||||||
<Stack spacing={0}>
|
|
||||||
<Text fz={"xs"}>Nama Bank</Text>
|
|
||||||
<Text fz={"xs"}>10 Oktober 2023</Text>
|
|
||||||
</Stack>
|
|
||||||
{(() => {
|
|
||||||
if (e.status.id === 1) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Title order={5} c={"green"}>
|
|
||||||
Berhasil
|
|
||||||
</Title>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
if (e.status.id === 2) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Title order={5} c={"orange"}>
|
|
||||||
Menunggu
|
|
||||||
</Title>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
if (e.status.id === 3) {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<>
|
|
||||||
<Title order={5} c={"blue"}>
|
|
||||||
Proses
|
|
||||||
</Title>
|
|
||||||
</>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Title order={5} c={"red"}>
|
|
||||||
Dibatalkan
|
|
||||||
</Title>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})()}
|
|
||||||
</Group>
|
|
||||||
</Paper>
|
|
||||||
))}
|
|
||||||
</Stack>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
129
src/app_modules/investasi/transaksi/view.tsx
Normal file
129
src/app_modules/investasi/transaksi/view.tsx
Normal file
@@ -0,0 +1,129 @@
|
|||||||
|
"use client";
|
||||||
|
|
||||||
|
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||||
|
import { Badge, Group, Paper, Stack, Text, Title } from "@mantine/core";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import toast from "react-simple-toasts";
|
||||||
|
import {
|
||||||
|
MODEL_Transaksi_Investasi,
|
||||||
|
Model_Status_Transaksi_Investasi,
|
||||||
|
} from "../model/model_investasi";
|
||||||
|
import { useState } from "react";
|
||||||
|
import moment from "moment";
|
||||||
|
import funCountDown from "../fun/fun_countdown_investasi";
|
||||||
|
import funGantiStatusTransaksi_Investasi from "../fun/fun_ganti_status_transaksi";
|
||||||
|
import { useInterval, useShallowEffect } from "@mantine/hooks";
|
||||||
|
|
||||||
|
export default function TransaksiInvestasi({
|
||||||
|
statusTransaksi,
|
||||||
|
listTransaksi,
|
||||||
|
}: {
|
||||||
|
statusTransaksi: Model_Status_Transaksi_Investasi[];
|
||||||
|
listTransaksi: MODEL_Transaksi_Investasi[];
|
||||||
|
}) {
|
||||||
|
const router = useRouter();
|
||||||
|
const [status, setStatus] = useState(statusTransaksi);
|
||||||
|
const [transaksi, setTransaksi] = useState(listTransaksi);
|
||||||
|
|
||||||
|
|
||||||
|
async function onKlik(statusId: string, transaksiId: string) {
|
||||||
|
// console.log(id)
|
||||||
|
if (statusId === "1") {
|
||||||
|
return router.push(RouterInvestasi.transfer + transaksiId);
|
||||||
|
} else {
|
||||||
|
if (statusId === "2") {
|
||||||
|
return router.push(RouterInvestasi.transfer);
|
||||||
|
} else {
|
||||||
|
if (statusId === "3") {
|
||||||
|
return router.push(RouterInvestasi.dialog_transaksi);
|
||||||
|
} else {
|
||||||
|
return router.push(
|
||||||
|
RouterInvestasi.status_transaksi_gagal + transaksiId
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Stack>
|
||||||
|
{transaksi.map((e) => (
|
||||||
|
<Paper
|
||||||
|
key={e.id}
|
||||||
|
p="xs"
|
||||||
|
bg={"gray"}
|
||||||
|
onClick={() => onKlik(e.masterStatusTransaksiInvestasiId, e.id)}
|
||||||
|
>
|
||||||
|
<Group position="apart">
|
||||||
|
<Title order={6}>{e.Investasi.title}</Title>
|
||||||
|
<Title order={5}>Rp.{e.totalTransfer}</Title>
|
||||||
|
</Group>
|
||||||
|
<Group position="apart">
|
||||||
|
<Stack spacing={0}>
|
||||||
|
<Text fz={"xs"}>Bank {e.namaBank}</Text>
|
||||||
|
<Text fz={"xs"}>{moment(e.createdAt).format("ll")}</Text>
|
||||||
|
</Stack>
|
||||||
|
{(() => {
|
||||||
|
if (e.masterStatusTransaksiInvestasiId === "1") {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Title
|
||||||
|
order={5}
|
||||||
|
c={e.MasterStatusTransaksiInvestasi.color}
|
||||||
|
>
|
||||||
|
{e.MasterStatusTransaksiInvestasi.name}
|
||||||
|
</Title>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
if (e.masterStatusTransaksiInvestasiId === "2") {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Title
|
||||||
|
order={5}
|
||||||
|
c={e.MasterStatusTransaksiInvestasi.color}
|
||||||
|
>
|
||||||
|
{e.MasterStatusTransaksiInvestasi.name}
|
||||||
|
</Title>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
if (e.masterStatusTransaksiInvestasiId === "3") {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<>
|
||||||
|
<Title
|
||||||
|
order={5}
|
||||||
|
c={e.MasterStatusTransaksiInvestasi.color}
|
||||||
|
>
|
||||||
|
{e.MasterStatusTransaksiInvestasi.name}
|
||||||
|
</Title>
|
||||||
|
</>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Title
|
||||||
|
order={5}
|
||||||
|
c={e.MasterStatusTransaksiInvestasi.color}
|
||||||
|
>
|
||||||
|
{e.MasterStatusTransaksiInvestasi.name}
|
||||||
|
</Title>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})()}
|
||||||
|
</Group>
|
||||||
|
</Paper>
|
||||||
|
))}
|
||||||
|
</Stack>
|
||||||
|
{/* <pre>{JSON.stringify(transaksi, null, 2)}</pre> */}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -19,10 +19,10 @@ import {
|
|||||||
Text,
|
Text,
|
||||||
Title,
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useInterval, useShallowEffect } from "@mantine/hooks";
|
||||||
import { IconAlertTriangle } from "@tabler/icons-react";
|
import { IconAlertTriangle } from "@tabler/icons-react";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { useRouter } from "next/navigation";
|
import { redirect, useRouter } from "next/navigation";
|
||||||
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import Countdown from "react-countdown";
|
import Countdown from "react-countdown";
|
||||||
@@ -33,6 +33,7 @@ import {
|
|||||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { gs_TransferValue, gs_investasiFooter } from "../g_state";
|
import { gs_TransferValue, gs_investasiFooter } from "../g_state";
|
||||||
|
import funGantiStatusTransaksi_Investasi from "../fun/fun_ganti_status_transaksi";
|
||||||
|
|
||||||
export default function TransferInvestasi({
|
export default function TransferInvestasi({
|
||||||
dataTransaksi,
|
dataTransaksi,
|
||||||
@@ -41,13 +42,11 @@ export default function TransferInvestasi({
|
|||||||
}) {
|
}) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [transaksi, setTransaksi] = useState(dataTransaksi);
|
const [transaksi, setTransaksi] = useState(dataTransaksi);
|
||||||
const [hotMenu, setHotMenu] = useAtom(gs_investasiFooter);
|
const [countDown, setCountDown] = useState<number | any>({
|
||||||
const [countDown, setCountDown] = useState({
|
jam: null,
|
||||||
jam: "",
|
menit: null,
|
||||||
menit: "",
|
detik: null,
|
||||||
detik: "",
|
|
||||||
});
|
});
|
||||||
const [transferValue, setTransferValue] = useAtom(gs_TransferValue);
|
|
||||||
|
|
||||||
// useShallowEffect(() => {
|
// useShallowEffect(() => {
|
||||||
// const inter = apa_kabar("2023-11-18");
|
// const inter = apa_kabar("2023-11-18");
|
||||||
@@ -63,36 +62,45 @@ export default function TransferInvestasi({
|
|||||||
// return inter;
|
// return inter;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
useShallowEffect(() => {
|
// useShallowEffect(() => {
|
||||||
const mulai = moment(transaksi.createdAt).format();
|
// const mulai = moment(transaksi.createdAt).format();
|
||||||
const selesai = moment(transaksi.createdAt).add(1, "days").format();
|
// const selesai = moment(transaksi.createdAt).add(1, "days").format();
|
||||||
const inter = funCountDown(mulai as any, selesai as any);
|
// const timer = funCountDown(mulai as any, selesai as any);
|
||||||
|
|
||||||
return () => clearInterval(inter);
|
// return () => clearInterval(timer);
|
||||||
}, []);
|
// }, []);
|
||||||
|
|
||||||
function funCountDown(mulai: Date, selesai: Date) {
|
// functionbaru ==========================//
|
||||||
// console.log(selesai)
|
const selesai = moment(transaksi.createdAt).add(1, "days").format();
|
||||||
let d = moment.duration(moment(selesai).diff(new Date()));
|
let durasi = moment.duration(moment(selesai).diff(new Date()));
|
||||||
const inter = setInterval(() => {
|
const interval = useInterval(() => {
|
||||||
d = moment.duration(+d - 1000, "milliseconds");
|
durasi = moment.duration(+durasi - 1000, "milliseconds");
|
||||||
// console.log(d.hours(), d.minutes(), d.seconds())
|
if (durasi.hours() <= 0 && durasi.minutes() <= 0 && durasi.seconds() <= 0) {
|
||||||
|
funGantiStatusTransaksi_Investasi(transaksi.id, "4").then((res) => {
|
||||||
setCountDown({
|
if (res.status === 200) {
|
||||||
...countDown,
|
router.push(
|
||||||
jam: "" + d.hours(),
|
RouterInvestasi.status_transaksi_gagal + `${transaksi.id}`
|
||||||
menit: "" + d.minutes(),
|
);
|
||||||
detik: "" + d.seconds(),
|
interval.stop();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}, 1000);
|
}
|
||||||
|
setCountDown({
|
||||||
|
...countDown,
|
||||||
|
jam: durasi.hours(),
|
||||||
|
menit: durasi.minutes(),
|
||||||
|
detik: durasi.seconds(),
|
||||||
|
});
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
return inter;
|
useShallowEffect(() => {
|
||||||
}
|
interval.start();
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <pre>{JSON.stringify(transferValue, null, 2)}</pre>
|
{/* <pre>{JSON.stringify(transaksi, null,2)}</pre> */}
|
||||||
<pre>{JSON.stringify(transaksi, null,2)}</pre> */}
|
{/* {countDown.jam} */}
|
||||||
<Stack spacing={"lg"}>
|
<Stack spacing={"lg"}>
|
||||||
<Stack spacing={0} mb={"xs"}>
|
<Stack spacing={0} mb={"xs"}>
|
||||||
<Text fz={12}>Mohon transfer untuk diteruskan ke :</Text>
|
<Text fz={12}>Mohon transfer untuk diteruskan ke :</Text>
|
||||||
@@ -106,18 +114,18 @@ export default function TransferInvestasi({
|
|||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={5}>
|
<Grid.Col span={5}>
|
||||||
<Text fz={"xs"} fw={"bold"}>
|
<Text fz={"xs"} fw={"bold"}>
|
||||||
{moment().add(1, "days").calendar()}
|
{moment(transaksi.createdAt).format("lll")}
|
||||||
</Text>
|
</Text>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={3} fz={"xs"}>
|
<Grid.Col span={3} fz={"xs"}>
|
||||||
<Paper bg={"red"} px={"md"}>
|
<Paper bg={"red"} px={"xs"}>
|
||||||
<Center>
|
<Center>
|
||||||
{countDown.jam === "0" &&
|
{countDown.jam <= 0 &&
|
||||||
countDown.menit === "0" &&
|
countDown.menit <= 0 &&
|
||||||
countDown.detik === "0" ? (
|
countDown.detik <= 0 ? (
|
||||||
<Box>
|
<Flex align={"center"} justify={"center"}>
|
||||||
<Text>Waktu habis</Text>
|
<Text fz={9}>Waktu Habis</Text>
|
||||||
</Box>
|
</Flex>
|
||||||
) : (
|
) : (
|
||||||
<Box>
|
<Box>
|
||||||
{countDown.jam}:{countDown.menit}:{countDown.detik}
|
{countDown.jam}:{countDown.menit}:{countDown.detik}
|
||||||
@@ -220,7 +228,7 @@ export default function TransferInvestasi({
|
|||||||
bg={Warna.biru}
|
bg={Warna.biru}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
router.push(RouterInvestasi.dialog_transaksi);
|
router.push(RouterInvestasi.dialog_transaksi);
|
||||||
setHotMenu(1);
|
// setHotMenu(1);
|
||||||
// router.push(RouterInvestasi.status_transaksi);
|
// router.push(RouterInvestasi.status_transaksi);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user