Revisi tampilan
fix: - alur pembuatan investasi - tampilan investasi ### No issue
@@ -129,7 +129,7 @@ model Investasi {
|
|||||||
ProspektusInvestasi ProspektusInvestasi?
|
ProspektusInvestasi ProspektusInvestasi?
|
||||||
|
|
||||||
MasterStatusInvestasi MasterStatusInvestasi? @relation(fields: [masterStatusInvestasiId], references: [id])
|
MasterStatusInvestasi MasterStatusInvestasi? @relation(fields: [masterStatusInvestasiId], references: [id])
|
||||||
masterStatusInvestasiId String? @default("1")
|
masterStatusInvestasiId String? @default("2")
|
||||||
BeritaInvestasi BeritaInvestasi[]
|
BeritaInvestasi BeritaInvestasi[]
|
||||||
DokumenInvestasi DokumenInvestasi[]
|
DokumenInvestasi DokumenInvestasi[]
|
||||||
|
|
||||||
@@ -175,13 +175,13 @@ model MasterStatusInvestasi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
model ProspektusInvestasi {
|
model ProspektusInvestasi {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
url String
|
url String
|
||||||
active Boolean @default(true)
|
active Boolean @default(true)
|
||||||
createdAt DateTime @default(now())
|
createdAt DateTime @default(now())
|
||||||
updatedAt DateTime @default(now()) @updatedAt
|
updatedAt DateTime @default(now()) @updatedAt
|
||||||
investasi Investasi @relation(fields: [investasiId], references: [id])
|
investasi Investasi? @relation(fields: [investasiId], references: [id])
|
||||||
investasiId String @unique
|
investasiId String? @unique
|
||||||
}
|
}
|
||||||
|
|
||||||
model DokumenInvestasi {
|
model DokumenInvestasi {
|
||||||
|
|||||||
BIN
public/aset/investasi/logo-crowd-panjang.png
Normal file
|
After Width: | Height: | Size: 1.6 MiB |
BIN
public/aset/investasi/logo-crowd.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
public/aset/logo/logo-hipmi round white.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
public/aset/logo/logo-hipmi round.png
Normal file
|
After Width: | Height: | Size: 51 KiB |
BIN
public/aset/logo/logo-hipmi.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
public/file/141f0ac6-35da-4fab-85ff-00b45a5309cd.pdf
Normal file
|
After Width: | Height: | Size: 268 KiB |
BIN
public/file/468be397-9d62-4460-9bb6-faccfd8eb281.pdf
Normal file
BIN
public/file/582a646d-d759-43d6-b13f-3eb53a6ec163.pdf
Normal file
|
After Width: | Height: | Size: 217 KiB |
BIN
public/file/a30d0a2f-9100-4050-ae97-98dc0a2e65e7.pdf
Normal file
|
After Width: | Height: | Size: 132 KiB |
BIN
public/file/abd76cdd-0e65-4f16-a140-c6deba83dd03.pdf
Normal file
BIN
public/file/baf07727-04e6-4d0f-992c-127a1ed4507b.pdf
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
public/file/efba92c1-8046-40bb-8d3b-26798bcb8f66.pdf
Normal file
|
After Width: | Height: | Size: 202 KiB |
BIN
public/investasi/06be991a-5cae-4f43-aff7-6633a74ca1d2.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
public/investasi/1ab54dd8-b475-48e8-9b6e-5accaea2e5f1.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
public/investasi/1cd23a7f-cc3c-462e-8ebe-6a0685ce3ce5.png
Normal file
|
After Width: | Height: | Size: 268 KiB |
BIN
public/investasi/493f29c7-cb05-4da9-857a-af723081e50c.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
public/investasi/4d7588e7-72e3-43ea-967b-debe550cf815.png
Normal file
|
After Width: | Height: | Size: 94 KiB |
BIN
public/investasi/504a0838-2150-42cd-b676-35911b6cb8c4.png
Normal file
|
After Width: | Height: | Size: 60 KiB |
BIN
public/investasi/6aed26d9-05a7-4221-8bd8-962423ddb0cf.jpeg
Normal file
|
After Width: | Height: | Size: 194 KiB |
BIN
public/investasi/765a62b7-6ee1-4f12-8e5d-3086915069db.png
Normal file
|
After Width: | Height: | Size: 202 KiB |
BIN
public/investasi/7d2a8cf7-87c3-4cc4-909f-bd7be4c39455.jpeg
Normal file
|
After Width: | Height: | Size: 110 KiB |
BIN
public/investasi/8ea21c1a-dfe4-477a-b2ad-645d1ca629d5.jpeg
Normal file
|
After Width: | Height: | Size: 194 KiB |
BIN
public/investasi/a8c86b04-3ef6-46f4-9429-b045f0eb2f2e.png
Normal file
|
After Width: | Height: | Size: 268 KiB |
BIN
public/investasi/ab83c188-53ac-464a-affe-a07abb120cb6.jpeg
Normal file
|
After Width: | Height: | Size: 132 KiB |
BIN
public/investasi/c7cb7f17-abd1-46e2-8d0b-e789f5f6a67f.jpeg
Normal file
|
After Width: | Height: | Size: 217 KiB |
BIN
public/investasi/c85e75fe-33cd-4063-8941-bf9607f3b1f6.jpeg
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
public/investasi/cd94b40e-749c-44c0-9206-c6487c748ae3.png
Normal file
|
After Width: | Height: | Size: 268 KiB |
BIN
public/investasi/e290bf5c-8062-4e4f-a5ee-54b731f2d0b8.jpeg
Normal file
|
After Width: | Height: | Size: 194 KiB |
@@ -1,6 +1,7 @@
|
|||||||
import { Admin_Investasi } from "@/app_modules/admin/investasi";
|
import { Admin_Investasi } from "@/app_modules/admin/investasi";
|
||||||
import Admin_CountStatusInvestasi from "@/app_modules/admin/investasi/fun/count_status";
|
import Admin_CountStatusInvestasi from "@/app_modules/admin/investasi/fun/count_status";
|
||||||
import Admin_funGetAllInvestasi from "@/app_modules/admin/investasi/fun/get_all_investasi";
|
import Admin_funGetAllInvestasi from "@/app_modules/admin/investasi/fun/get_all_investasi";
|
||||||
|
import Admin_getTotalInvestasiByUser from "@/app_modules/admin/investasi/fun/get_total_investasi_by_user";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const listInvestasi = await Admin_funGetAllInvestasi();
|
const listInvestasi = await Admin_funGetAllInvestasi();
|
||||||
@@ -8,6 +9,8 @@ export default async function Page() {
|
|||||||
const countReview = await Admin_CountStatusInvestasi(2);
|
const countReview = await Admin_CountStatusInvestasi(2);
|
||||||
const countPublish = await Admin_CountStatusInvestasi(3);
|
const countPublish = await Admin_CountStatusInvestasi(3);
|
||||||
const countReject = await Admin_CountStatusInvestasi(4);
|
const countReject = await Admin_CountStatusInvestasi(4);
|
||||||
|
const totalInvestasiByUser = await Admin_getTotalInvestasiByUser()
|
||||||
|
// console.log(totalInvestasi)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -17,8 +20,10 @@ export default async function Page() {
|
|||||||
countReview={countReview}
|
countReview={countReview}
|
||||||
countPublish={countPublish}
|
countPublish={countPublish}
|
||||||
countReject={countReject}
|
countReject={countReject}
|
||||||
|
totalInvestasiByUser={totalInvestasiByUser}
|
||||||
|
|
||||||
/>
|
/>
|
||||||
|
{/* <pre>{JSON.stringify(totalInvestasiByUser, null,2)}</pre> */}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ export const RouterInvestasi = {
|
|||||||
|
|
||||||
//INVESTASI
|
//INVESTASI
|
||||||
main: "/dev/investasi/main",
|
main: "/dev/investasi/main",
|
||||||
|
create: "/dev/investasi/create",
|
||||||
main_porto: "/dev/investasi/main/portofolio",
|
main_porto: "/dev/investasi/main/portofolio",
|
||||||
main_investasi: "/dev/investasi/main/saham_saya",
|
main_investasi: "/dev/investasi/main/saham_saya",
|
||||||
main_transaksi: "/dev/investasi/main/transaksi",
|
main_transaksi: "/dev/investasi/main/transaksi",
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { RouterAdminInvestasi } from "@/app/lib/router_hipmi/router_admin"
|
|||||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi"
|
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi"
|
||||||
import { revalidatePath } from "next/cache"
|
import { revalidatePath } from "next/cache"
|
||||||
|
|
||||||
export default async function funRejectInvestasi(data: any) {
|
export default async function Admin_funRejectInvestasi(data: any) {
|
||||||
// console.log(data)
|
// console.log(data)
|
||||||
|
|
||||||
const res = await prisma.investasi.update({
|
const res = await prisma.investasi.update({
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
"use server";
|
||||||
|
|
||||||
|
import prisma from "@/app/lib/prisma";
|
||||||
|
|
||||||
|
export default async function Admin_getTotalInvestasiByUser() {
|
||||||
|
const data = await prisma.user.findMany({
|
||||||
|
include: {
|
||||||
|
_count: {
|
||||||
|
select: {
|
||||||
|
Investasi: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
@@ -52,7 +52,7 @@ import Link from "next/link";
|
|||||||
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 toast from "react-simple-toasts";
|
||||||
import funRejectInvestasi from "../fun/fun_reject_investasi";
|
import Admin_funRejectInvestasi from "../fun/fun_reject_investasi";
|
||||||
|
|
||||||
export default function Admin_KonfirmasiInvestasi({
|
export default function Admin_KonfirmasiInvestasi({
|
||||||
dataInvestasi,
|
dataInvestasi,
|
||||||
@@ -105,7 +105,7 @@ export default function Admin_KonfirmasiInvestasi({
|
|||||||
status: "4",
|
status: "4",
|
||||||
};
|
};
|
||||||
if (_.isEmpty(body.catatan)) return toast("Lengkapi alasan");
|
if (_.isEmpty(body.catatan)) return toast("Lengkapi alasan");
|
||||||
await funRejectInvestasi(body).then((res) => {
|
await Admin_funRejectInvestasi(body).then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
toast(res.message);
|
toast(res.message);
|
||||||
toggle();
|
toggle();
|
||||||
|
|||||||
@@ -4,11 +4,13 @@ import { RouterAdminInvestasi } from "@/app/lib/router_hipmi/router_admin";
|
|||||||
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
|
Avatar,
|
||||||
Badge,
|
Badge,
|
||||||
Box,
|
Box,
|
||||||
Center,
|
Center,
|
||||||
Divider,
|
Divider,
|
||||||
Grid,
|
Grid,
|
||||||
|
Group,
|
||||||
Paper,
|
Paper,
|
||||||
ScrollArea,
|
ScrollArea,
|
||||||
Stack,
|
Stack,
|
||||||
@@ -29,12 +31,14 @@ export default function Admin_Investasi({
|
|||||||
countReview,
|
countReview,
|
||||||
countPublish,
|
countPublish,
|
||||||
countReject,
|
countReject,
|
||||||
|
totalInvestasiByUser,
|
||||||
}: {
|
}: {
|
||||||
listInvestasi: MODEL_Investasi[];
|
listInvestasi: MODEL_Investasi[];
|
||||||
countDraft: number | any;
|
countDraft: number | any;
|
||||||
countReview: number | any;
|
countReview: number | any;
|
||||||
countPublish: number | any;
|
countPublish: number | any;
|
||||||
countReject: number | any;
|
countReject: number | any;
|
||||||
|
totalInvestasiByUser: any[];
|
||||||
}) {
|
}) {
|
||||||
const [investasi, setInvestasi] = useState(listInvestasi);
|
const [investasi, setInvestasi] = useState(listInvestasi);
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -44,21 +48,28 @@ export default function Admin_Investasi({
|
|||||||
id: 1,
|
id: 1,
|
||||||
name: "Draft",
|
name: "Draft",
|
||||||
jumlah: countDraft,
|
jumlah: countDraft,
|
||||||
|
color: "yellow"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 2,
|
id: 2,
|
||||||
name: "Review",
|
name: "Review",
|
||||||
jumlah: countReview,
|
jumlah: countReview,
|
||||||
|
color: "orange"
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 3,
|
id: 3,
|
||||||
name: "Publish",
|
name: "Publish",
|
||||||
jumlah: countPublish,
|
jumlah: countPublish,
|
||||||
|
color: "green"
|
||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 4,
|
id: 4,
|
||||||
name: "Reject",
|
name: "Reject",
|
||||||
jumlah: countReject,
|
jumlah: countReject,
|
||||||
|
color: "red"
|
||||||
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -69,7 +80,12 @@ export default function Admin_Investasi({
|
|||||||
<Grid mb={"md"}>
|
<Grid mb={"md"}>
|
||||||
{listBox.map((e) => (
|
{listBox.map((e) => (
|
||||||
<Grid.Col sm={12} md={6} lg={3} key={e.id}>
|
<Grid.Col sm={12} md={6} lg={3} key={e.id}>
|
||||||
<Paper h={100} bg={"gray"} p={"xs"}>
|
<Paper
|
||||||
|
h={100}
|
||||||
|
p={"xs"}
|
||||||
|
bg={"gray"}
|
||||||
|
// bg={e.color}
|
||||||
|
>
|
||||||
<Center>
|
<Center>
|
||||||
<Stack spacing={0}>
|
<Stack spacing={0}>
|
||||||
<Text>{e.name}</Text>
|
<Text>{e.name}</Text>
|
||||||
@@ -84,16 +100,29 @@ export default function Admin_Investasi({
|
|||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
))}
|
))}
|
||||||
</Grid>
|
</Grid>
|
||||||
<TablePublish dataInvestsi={investasi as any} />
|
<Paper w={300} radius={"md"} p={"sm"} sx={{borderStyle: "solid", borderColor: "teal"}} >
|
||||||
|
<Title order={4}>Investasi by User</Title>
|
||||||
|
<Table >
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th><Center>Username</Center></th>
|
||||||
|
<th><Center>Total</Center></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{totalInvestasiByUser.map((e) => (
|
||||||
|
<tr key={e.id}>
|
||||||
|
<td><Group><Avatar variant="light" radius={"xl"}/> {e.username}</Group></td>
|
||||||
|
<td><Center>{e._count.Investasi}</Center></td>
|
||||||
|
</tr>
|
||||||
|
))}
|
||||||
|
</tbody>
|
||||||
|
</Table>
|
||||||
|
</Paper>
|
||||||
|
{/* <TablePublish dataInvestsi={investasi as any} />
|
||||||
<TableReview dataInvestsi={investasi as any} />
|
<TableReview dataInvestsi={investasi as any} />
|
||||||
<TableReject dataInvestsi={investasi as any} />
|
<TableReject dataInvestsi={investasi as any} /> */}
|
||||||
{/* <pre>{JSON.stringify(investasi, null, 2)}</pre> */}
|
{/* <pre>{JSON.stringify(totalInvestasiByUser, null, 2)}</pre> */}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,30 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin";
|
import { RouterAdminDashboard } from "@/app/lib/router_hipmi/router_admin";
|
||||||
import { Stack, Text, Title } from "@mantine/core";
|
import { AspectRatio, Center, Image, Stack, Text, Title } from "@mantine/core";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
export default function SplashDashboardAdmin() {
|
export default function SplashDashboardAdmin() {
|
||||||
const router = useRouter()
|
const router = useRouter();
|
||||||
useShallowEffect(() => {
|
useShallowEffect(() => {
|
||||||
setTimeout(() => router.push(RouterAdminDashboard.main_admin), 2000)
|
setTimeout(() => router.push(RouterAdminDashboard.main_admin), 2000)
|
||||||
},[])
|
}, []);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack align="center" justify="center" h={"100vh"}>
|
{/* <Stack align="center" justify="center" h={"100vh"}>
|
||||||
<Title order={4} c={"orange"}>Selamat Datang, ADMIN</Title>
|
<Title order={4} c={"orange"}>
|
||||||
|
Selamat Datang, ADMIN
|
||||||
|
</Title>
|
||||||
<Title c={"red"}>HIPMI</Title>
|
<Title c={"red"}>HIPMI</Title>
|
||||||
|
|
||||||
</Stack>
|
</Stack> */}
|
||||||
|
<AspectRatio ratio={16 / 9}>
|
||||||
|
<Image src={"/aset/logo/logo-hipmi.png"} alt="Logo" />
|
||||||
|
</AspectRatio>
|
||||||
|
<Center>
|
||||||
|
<Title>Welcome Admin</Title>
|
||||||
|
</Center>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,16 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { Flex, Title } from "@mantine/core";
|
import {
|
||||||
|
AspectRatio,
|
||||||
|
Box,
|
||||||
|
Center,
|
||||||
|
Flex,
|
||||||
|
Image,
|
||||||
|
Paper,
|
||||||
|
Stack,
|
||||||
|
Text,
|
||||||
|
Title,
|
||||||
|
} from "@mantine/core";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
@@ -22,9 +32,19 @@ export default function SplashScreen({ data }: { data: any }) {
|
|||||||
}, []);
|
}, []);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Flex justify={"center"} align={"center"} h={"100vh"}>
|
<Center h={"100vh"}>
|
||||||
<Title order={1}>Splash Screen</Title>
|
<Stack align="center" justify="center" p={"md"}>
|
||||||
</Flex>
|
{/* <Title c={"#002e59"}>Welcome to</Title> */}
|
||||||
|
<Paper
|
||||||
|
p={{ base: 50, md: 60, lg: 80 }}
|
||||||
|
bg={"gray.1"}
|
||||||
|
radius={500}
|
||||||
|
shadow="xl"
|
||||||
|
>
|
||||||
|
<Image alt="" src={"/aset/logo/logo-hipmi.png"} />
|
||||||
|
</Paper>
|
||||||
|
</Stack>
|
||||||
|
</Center>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,8 +83,8 @@ export default function Validasi() {
|
|||||||
direction={"column"}
|
direction={"column"}
|
||||||
align={"center"}
|
align={"center"}
|
||||||
>
|
>
|
||||||
<Text>Enter the 6-digit OTP , we’ve just sent</Text>
|
<Text>Enter the 4-digit OTP , we’ve just sent</Text>
|
||||||
<Text>to {nomor}</Text>
|
<Text>to +{nomor}</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
<PinInput
|
<PinInput
|
||||||
ref={focusTrapRef}
|
ref={focusTrapRef}
|
||||||
|
|||||||
@@ -6,12 +6,15 @@ import {
|
|||||||
AspectRatio,
|
AspectRatio,
|
||||||
Button,
|
Button,
|
||||||
Center,
|
Center,
|
||||||
|
Flex,
|
||||||
|
Grid,
|
||||||
Image,
|
Image,
|
||||||
Paper,
|
Paper,
|
||||||
Stack,
|
Stack,
|
||||||
Text,
|
Text,
|
||||||
Title,
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
|
import { IconChevronRight } from "@tabler/icons-react";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import toast from "react-simple-toasts";
|
import toast from "react-simple-toasts";
|
||||||
@@ -22,32 +25,57 @@ export default function MainCrowd() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Paper bg={"gray"}>
|
<Paper>
|
||||||
<AspectRatio ratio={16 / 9}>
|
<AspectRatio ratio={16 / 9}>
|
||||||
<Image alt="" src={"/aset/logo.png"} />
|
<Paper radius={"md"}>
|
||||||
|
<Image alt="" src={"/aset/investasi/logo-crowd-panjang.png"} />
|
||||||
|
</Paper>
|
||||||
</AspectRatio>
|
</AspectRatio>
|
||||||
</Paper>
|
</Paper>
|
||||||
<Stack align="center">
|
<Stack>
|
||||||
<Button
|
<Paper
|
||||||
w={300}
|
p={"xs"}
|
||||||
radius={50}
|
radius={"md"}
|
||||||
bg={Warna.hijau_tua}
|
bg={"teal"}
|
||||||
color="green"
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
router.push("/dev/investasi/main");
|
router.push("/dev/investasi/main");
|
||||||
setChangeColor(0);
|
setChangeColor(0);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
Investasi
|
<Grid>
|
||||||
</Button>
|
<Grid.Col span={10}>
|
||||||
<Button
|
<Title order={4}> Investasi</Title>
|
||||||
w={300}
|
<Text fz={12}>
|
||||||
|
Buat investasi dan jual beli saham lebih mudah dengan pengguna lain dengan CROWD INVESTASI
|
||||||
|
</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={2}>
|
||||||
|
<Stack h={"100%"} justify="center" align="center">
|
||||||
|
<IconChevronRight />
|
||||||
|
</Stack>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</Paper>
|
||||||
|
<Paper
|
||||||
bg={Warna.biru}
|
bg={Warna.biru}
|
||||||
radius={50}
|
radius={"md"}
|
||||||
|
p={"xs"}
|
||||||
onClick={() => toast("Cooming Soon Feature...")}
|
onClick={() => toast("Cooming Soon Feature...")}
|
||||||
>
|
>
|
||||||
Donasi
|
<Grid>
|
||||||
</Button>
|
<Grid.Col span={10}>
|
||||||
|
<Title order={4}> Donasi</Title>
|
||||||
|
<Text fz={12}>
|
||||||
|
Berbagi info untuk berdonasi lebih luas dan lebih mudah dengan CROWD DONASI
|
||||||
|
</Text>
|
||||||
|
</Grid.Col>
|
||||||
|
<Grid.Col span={2}>
|
||||||
|
<Stack h={"100%"} justify="center" align="center">
|
||||||
|
<IconChevronRight />
|
||||||
|
</Stack>
|
||||||
|
</Grid.Col>
|
||||||
|
</Grid>
|
||||||
|
</Paper>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { Center, Stack, Text, Title } from "@mantine/core";
|
import { Warna } from "@/app/lib/warna";
|
||||||
|
import { Center, Image, Stack, Text, Title } from "@mantine/core";
|
||||||
import { useShallowEffect } from "@mantine/hooks";
|
import { useShallowEffect } from "@mantine/hooks";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
@@ -14,9 +15,8 @@ export default function SplashCrowd() {
|
|||||||
<>
|
<>
|
||||||
<Center h={"100vh"}>
|
<Center h={"100vh"}>
|
||||||
<Stack align="center" justify="center">
|
<Stack align="center" justify="center">
|
||||||
<Text>Welcome to,</Text>
|
<Title c={"#002e59"}>Welcome to</Title>
|
||||||
<Title>HIPMI</Title>
|
<Image alt="" src={"/aset/investasi/logo-crowd.png"} />
|
||||||
<Title order={3}>CrowdFunding</Title>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</Center>
|
</Center>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import {
|
|||||||
Paper,
|
Paper,
|
||||||
SimpleGrid,
|
SimpleGrid,
|
||||||
Text,
|
Text,
|
||||||
|
ThemeIcon,
|
||||||
Title,
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { Logout } from "../auth";
|
import { Logout } from "../auth";
|
||||||
@@ -153,7 +154,7 @@ export default function HomeView({ user }: { user: MODEL_User_profile }) {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
if (e.link === "") {
|
if (e.link === "") {
|
||||||
toast(e.name);
|
toast("Cooming Soon !!");
|
||||||
} else {
|
} else {
|
||||||
return router.push(e.link);
|
return router.push(e.link);
|
||||||
}
|
}
|
||||||
@@ -165,8 +166,14 @@ export default function HomeView({ user }: { user: MODEL_User_profile }) {
|
|||||||
direction={"column"}
|
direction={"column"}
|
||||||
h={100}
|
h={100}
|
||||||
>
|
>
|
||||||
{e.icon}
|
<ActionIcon
|
||||||
{e.name}
|
size={50}
|
||||||
|
variant="transparent"
|
||||||
|
color={e.link === "" ? "gray" : "teal"}
|
||||||
|
>
|
||||||
|
{e.icon}
|
||||||
|
</ActionIcon>
|
||||||
|
<Text c={e.link === "" ? "gray" : "teal"}>{e.name}</Text>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Paper>
|
</Paper>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@@ -13,12 +13,13 @@ import {
|
|||||||
Group,
|
Group,
|
||||||
Image,
|
Image,
|
||||||
NumberInput,
|
NumberInput,
|
||||||
|
Paper,
|
||||||
Select,
|
Select,
|
||||||
Stack,
|
Stack,
|
||||||
Text,
|
Text,
|
||||||
TextInput,
|
TextInput,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { IconCamera } from "@tabler/icons-react";
|
import { IconCamera, IconPdf, IconUpload } from "@tabler/icons-react";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
@@ -43,6 +44,9 @@ export default function InvestasiCreate({
|
|||||||
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>();
|
||||||
|
const [pdf, setPdf] = useState<File | null>(null);
|
||||||
|
const [filePdf, setFilePdf] = useState<any | null>(null);
|
||||||
|
|
||||||
const [changeColor, setChangeColor] = useAtom(gs_investasiFooter);
|
const [changeColor, setChangeColor] = useAtom(gs_investasiFooter);
|
||||||
const [activeTab, setActiveTab] = useAtom(gs_StatusPortoInvestasi);
|
const [activeTab, setActiveTab] = useAtom(gs_StatusPortoInvestasi);
|
||||||
const [totalLembar, setTotalLembar] = useState(0);
|
const [totalLembar, setTotalLembar] = useState(0);
|
||||||
@@ -57,7 +61,6 @@ export default function InvestasiCreate({
|
|||||||
pembagianDevidenId: "",
|
pembagianDevidenId: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
async function onSubmit() {
|
async function onSubmit() {
|
||||||
const body = {
|
const body = {
|
||||||
authorId: id,
|
authorId: id,
|
||||||
@@ -72,18 +75,22 @@ export default function InvestasiCreate({
|
|||||||
};
|
};
|
||||||
// toast("Berhasil disimpan")
|
// toast("Berhasil disimpan")
|
||||||
|
|
||||||
|
// if (_.values(body).includes("")) return toast("Lengkapi data");
|
||||||
|
if (!fl) return toast("Gambar Kosong");
|
||||||
|
if (!pdf) return toast("File Kosong");
|
||||||
|
|
||||||
if (_.values(body).includes("")) return toast("Lengkapi data");
|
const gmbr = new FormData();
|
||||||
if (!fl) return toast("File Kosong");
|
gmbr.append("file", fl);
|
||||||
|
|
||||||
const fd = new FormData();
|
const flPdf = new FormData();
|
||||||
fd.append("file", fl);
|
flPdf.append("file", pdf);
|
||||||
await funCreateInvestasi(fd, body as any).then((res) => {
|
|
||||||
|
await funCreateInvestasi(gmbr, flPdf, body as any).then((res) => {
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
// toast(res.message);
|
// toast(res.message);
|
||||||
setChangeColor(1);
|
setChangeColor(1);
|
||||||
setActiveTab("Draft");
|
setActiveTab("Review");
|
||||||
router.push(RouterInvestasi.dialog_create)
|
router.push(RouterInvestasi.dialog_create);
|
||||||
} else {
|
} else {
|
||||||
toast(res.message);
|
toast(res.message);
|
||||||
}
|
}
|
||||||
@@ -98,40 +105,81 @@ export default function InvestasiCreate({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Box>
|
<Box>
|
||||||
<AspectRatio ratio={16 / 9}>
|
{/* Inputan Create */}
|
||||||
{img ? (
|
|
||||||
<Image alt="" src={img} />
|
|
||||||
) : (
|
|
||||||
<Image alt="" src={"/aset/no-img.png"} />
|
|
||||||
)}
|
|
||||||
</AspectRatio>
|
|
||||||
<Group position="center" mt={"md"}>
|
|
||||||
<FileButton
|
|
||||||
onChange={async (files: any) => {
|
|
||||||
const buffer = URL.createObjectURL(
|
|
||||||
new Blob([new Uint8Array(await files.arrayBuffer())])
|
|
||||||
);
|
|
||||||
setImg(buffer);
|
|
||||||
setFl(files);
|
|
||||||
}}
|
|
||||||
accept="image/png,image/jpeg"
|
|
||||||
>
|
|
||||||
{(props) => (
|
|
||||||
<Button
|
|
||||||
compact
|
|
||||||
{...props}
|
|
||||||
w={100}
|
|
||||||
radius={50}
|
|
||||||
bg={Warna.hijau_muda}
|
|
||||||
// onClick={() => router.push("/dev/investasi/upload")}
|
|
||||||
>
|
|
||||||
<IconCamera />
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
</FileButton>
|
|
||||||
</Group>
|
|
||||||
|
|
||||||
<Stack spacing={"sm"} px={"md"}>
|
<Stack spacing={"sm"} px={"md"}>
|
||||||
|
<AspectRatio ratio={16 / 9}>
|
||||||
|
<Paper radius={"md"} withBorder>
|
||||||
|
{img ? (
|
||||||
|
<Image alt="" src={img} />
|
||||||
|
) : (
|
||||||
|
<Image alt="" src={"/aset/no-img.png"} />
|
||||||
|
)}
|
||||||
|
</Paper>
|
||||||
|
</AspectRatio>
|
||||||
|
|
||||||
|
{/* Upload Foto */}
|
||||||
|
<Group position="center" mb={"md"}>
|
||||||
|
<FileButton
|
||||||
|
onChange={async (files: any) => {
|
||||||
|
const buffer = URL.createObjectURL(
|
||||||
|
new Blob([new Uint8Array(await files.arrayBuffer())])
|
||||||
|
);
|
||||||
|
// console.log(files);
|
||||||
|
setImg(buffer);
|
||||||
|
setFl(files);
|
||||||
|
}}
|
||||||
|
accept="image/png,image/jpeg"
|
||||||
|
>
|
||||||
|
{(props) => (
|
||||||
|
<Button
|
||||||
|
{...props}
|
||||||
|
leftIcon={<IconUpload size={12} />}
|
||||||
|
compact
|
||||||
|
radius={50}
|
||||||
|
bg={Warna.hijau_muda}
|
||||||
|
// onClick={() => router.push("/dev/investasi/upload")}
|
||||||
|
>
|
||||||
|
Upload Gambar
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</FileButton>
|
||||||
|
</Group>
|
||||||
|
{/* Upload File */}
|
||||||
|
<Group position="center">
|
||||||
|
{!pdf ? (
|
||||||
|
<Paper w={"100%"} bg={"gray.3"} p={"sm"}>
|
||||||
|
<Text opacity={"0.3"}>Upload File Prospektus</Text>
|
||||||
|
</Paper>
|
||||||
|
) : (
|
||||||
|
<Paper w={"100%"} bg={"gray.6"} p={"sm"}>
|
||||||
|
<Text>{pdf.name}</Text>
|
||||||
|
</Paper>
|
||||||
|
)}
|
||||||
|
{/* {JSON.stringify(filePdf)} */}
|
||||||
|
<FileButton
|
||||||
|
accept="application/pdf"
|
||||||
|
onChange={async (files: any) => {
|
||||||
|
const buffer = URL.createObjectURL(
|
||||||
|
new Blob([new Uint8Array(await files.arrayBuffer())])
|
||||||
|
);
|
||||||
|
// console.log(files.name)
|
||||||
|
setFilePdf(buffer);
|
||||||
|
setPdf(files);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{(props) => (
|
||||||
|
<Button
|
||||||
|
leftIcon={<IconUpload size={12} />}
|
||||||
|
{...props}
|
||||||
|
compact
|
||||||
|
radius={"xl"}
|
||||||
|
bg={Warna.hijau_muda}
|
||||||
|
>
|
||||||
|
Upload File
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
|
</FileButton>
|
||||||
|
</Group>
|
||||||
<TextInput
|
<TextInput
|
||||||
withAsterisk
|
withAsterisk
|
||||||
label="Judul Investasi"
|
label="Judul Investasi"
|
||||||
@@ -175,7 +223,7 @@ export default function InvestasiCreate({
|
|||||||
<Text>{totalLembar}</Text>
|
<Text>{totalLembar}</Text>
|
||||||
<Divider />
|
<Divider />
|
||||||
</Stack>
|
</Stack>
|
||||||
<Text c={"red"} fz={10}>
|
<Text c={"blue"} fz={10}>
|
||||||
*Total lembar dihitung dari, Target Dana : Harga Perlembar
|
*Total lembar dihitung dari, Target Dana : Harga Perlembar
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|||||||
@@ -146,11 +146,15 @@ export default function DetailInvestasi({
|
|||||||
<Stack>
|
<Stack>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Dana Dibutuhkan</Text>
|
<Text>Dana Dibutuhkan</Text>
|
||||||
<Text>Rp. {investasi.targetDana}</Text>
|
<Text>Rp. {new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+investasi.targetDana)}</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Harga Per Lembar</Text>
|
<Text>Harga Per Lembar</Text>
|
||||||
<Text>Rp. {investasi.hargaLembar}</Text>
|
<Text>Rp. {new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+investasi.hargaLembar)}</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Jadwal Pembagian</Text>
|
<Text>Jadwal Pembagian</Text>
|
||||||
@@ -170,11 +174,15 @@ export default function DetailInvestasi({
|
|||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Total Lembar</Text>
|
<Text>Total Lembar</Text>
|
||||||
<Text>{investasi.totalLembar} lembar</Text>
|
<Text>{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+investasi.totalLembar)} lembar</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Sisa Lembar</Text>
|
<Text>Sisa Lembar</Text>
|
||||||
<Text>{investasi.sisaLembar} lembar</Text>
|
<Text>{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+investasi.sisaLembar)} lembar</Text>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ export default function DetailDraftInvestasi({
|
|||||||
{/* Title dan Persentase */}
|
{/* Title dan Persentase */}
|
||||||
<Center>
|
<Center>
|
||||||
<Title order={4} mb={"xs"}>
|
<Title order={4} mb={"xs"}>
|
||||||
{investasi.title}
|
{_.capitalize(investasi.title)}
|
||||||
</Title>
|
</Title>
|
||||||
</Center>
|
</Center>
|
||||||
|
|
||||||
@@ -101,11 +101,15 @@ export default function DetailDraftInvestasi({
|
|||||||
<Stack>
|
<Stack>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Dana Dibutuhkan</Text>
|
<Text>Dana Dibutuhkan</Text>
|
||||||
<Text>Rp. {investasi.targetDana}</Text>
|
<Text>Rp. {new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+investasi.targetDana)}</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Harga Per Lembar</Text>
|
<Text>Harga Per Lembar</Text>
|
||||||
<Text>Rp. {investasi.hargaLembar}</Text>
|
<Text>Rp. {new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+investasi.hargaLembar)}</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Jadwal Pembagian</Text>
|
<Text>Jadwal Pembagian</Text>
|
||||||
@@ -121,11 +125,13 @@ export default function DetailDraftInvestasi({
|
|||||||
<Stack>
|
<Stack>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>ROI</Text>
|
<Text>ROI</Text>
|
||||||
<Text>{investasi.roi}%</Text>
|
<Text>{investasi.roi} %</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Total Lembar</Text>
|
<Text>Total Lembar</Text>
|
||||||
<Text>{investasi.totalLembar} lembar</Text>
|
<Text>{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+investasi.totalLembar)} lembar</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Pembagian Deviden</Text>
|
<Text>Pembagian Deviden</Text>
|
||||||
|
|||||||
@@ -109,16 +109,30 @@ export default function DetailPublishInvestasi({
|
|||||||
<Stack>
|
<Stack>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Dana Dibutuhkan</Text>
|
<Text>Dana Dibutuhkan</Text>
|
||||||
<Text>Rp. {investasi.targetDana}</Text>
|
<Text>
|
||||||
|
Rp.{" "}
|
||||||
|
{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+investasi.targetDana)}
|
||||||
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Harga Per Lembar</Text>
|
<Text>Harga Per Lembar</Text>
|
||||||
<Text>Rp. {investasi.hargaLembar}</Text>
|
<Text>
|
||||||
|
Rp.{" "}
|
||||||
|
{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+investasi.hargaLembar)}
|
||||||
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Jadwal Pembagian</Text>
|
<Text>Jadwal Pembagian</Text>
|
||||||
<Text>{investasi.MasterPembagianDeviden.name} bulan </Text>
|
<Text>{investasi.MasterPembagianDeviden.name} bulan </Text>
|
||||||
</Box>
|
</Box>
|
||||||
|
<Box>
|
||||||
|
<Text>Pembagian Deviden</Text>
|
||||||
|
<Text>{investasi.MasterPeriodeDeviden.name}</Text>
|
||||||
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
<Grid.Col span={6}>
|
<Grid.Col span={6}>
|
||||||
@@ -129,11 +143,21 @@ export default function DetailPublishInvestasi({
|
|||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Total Lembar</Text>
|
<Text>Total Lembar</Text>
|
||||||
<Text>{investasi.totalLembar} lembar</Text>
|
<Text>
|
||||||
|
{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+investasi.totalLembar)}{" "}
|
||||||
|
lembar
|
||||||
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Pembagian Deviden</Text>
|
<Text>Sisa Lembar</Text>
|
||||||
<Text>{investasi.MasterPeriodeDeviden.name}</Text>
|
<Text>
|
||||||
|
{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+investasi.sisaLembar)}{" "}
|
||||||
|
lembar
|
||||||
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ export default function LayoutDetailRejecttInvestasi({
|
|||||||
header={
|
header={
|
||||||
<HeaderTamplate
|
<HeaderTamplate
|
||||||
title="Detail Reject"
|
title="Detail Reject"
|
||||||
icon={<IconEdit />}
|
// icon={<IconEdit />}
|
||||||
route2={`/dev/investasi/edit/${idInves}`}
|
// route2={`/dev/investasi/edit/${idInves}`}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -22,9 +22,11 @@ import {
|
|||||||
Title,
|
Title,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import {
|
import {
|
||||||
|
IconArrowBackUpDouble,
|
||||||
IconBookDownload,
|
IconBookDownload,
|
||||||
IconFileDescription,
|
IconFileDescription,
|
||||||
IconSpeakerphone,
|
IconSpeakerphone,
|
||||||
|
IconTrash,
|
||||||
} from "@tabler/icons-react";
|
} from "@tabler/icons-react";
|
||||||
import { useAtom } from "jotai";
|
import { useAtom } from "jotai";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
@@ -59,20 +61,20 @@ export default function DetailRejectInvestasi({
|
|||||||
icon: <IconFileDescription size={70} />,
|
icon: <IconFileDescription size={70} />,
|
||||||
route: RouterInvestasi.edit_dokumen,
|
route: RouterInvestasi.edit_dokumen,
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
id: 3,
|
// id: 3,
|
||||||
name: "Berita",
|
// name: "Berita",
|
||||||
icon: <IconSpeakerphone size={70} />,
|
// icon: <IconSpeakerphone size={70} />,
|
||||||
route: RouterInvestasi.edit_berita,
|
// route: RouterInvestasi.edit_berita,
|
||||||
},
|
// },
|
||||||
];
|
];
|
||||||
|
|
||||||
async function onAjukan() {
|
async function onAjukan() {
|
||||||
await funGantiStatusInvestasi(investasi.id, "2").then((res) => {
|
await funGantiStatusInvestasi(investasi.id, "1").then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
toast("Project Diajukan Kembali");
|
toast("Project Diajukan Kembali");
|
||||||
|
setActiveTab("Draft");
|
||||||
router.push(RouterInvestasi.portofolio);
|
router.push(RouterInvestasi.portofolio);
|
||||||
setActiveTab("Review");
|
|
||||||
} else {
|
} else {
|
||||||
toast("Gagal Pengajuan");
|
toast("Gagal Pengajuan");
|
||||||
}
|
}
|
||||||
@@ -110,7 +112,7 @@ export default function DetailRejectInvestasi({
|
|||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
{/* Alasan */}
|
{/* Alasan */}
|
||||||
<Box mb={"sm"}>
|
<Box mb={"xl"}>
|
||||||
<Title order={6}>Alasan :</Title>
|
<Title order={6}>Alasan :</Title>
|
||||||
<Box>
|
<Box>
|
||||||
<Paper>
|
<Paper>
|
||||||
@@ -124,6 +126,7 @@ export default function DetailRejectInvestasi({
|
|||||||
<Grid.Col span={6}>
|
<Grid.Col span={6}>
|
||||||
<Center>
|
<Center>
|
||||||
<Button
|
<Button
|
||||||
|
leftIcon={<IconArrowBackUpDouble/>}
|
||||||
mb={"xl"}
|
mb={"xl"}
|
||||||
radius={50}
|
radius={50}
|
||||||
bg={"orange.7"}
|
bg={"orange.7"}
|
||||||
@@ -131,7 +134,7 @@ export default function DetailRejectInvestasi({
|
|||||||
compact
|
compact
|
||||||
onClick={() => onAjukan()}
|
onClick={() => onAjukan()}
|
||||||
>
|
>
|
||||||
Ajukan Kembali
|
Masuk ke Draft
|
||||||
</Button>
|
</Button>
|
||||||
</Center>
|
</Center>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
@@ -141,6 +144,7 @@ export default function DetailRejectInvestasi({
|
|||||||
<Center>
|
<Center>
|
||||||
{" "}
|
{" "}
|
||||||
<Button
|
<Button
|
||||||
|
leftIcon={<IconTrash size={12}/>}
|
||||||
compact
|
compact
|
||||||
mb={"xl"}
|
mb={"xl"}
|
||||||
radius={50}
|
radius={50}
|
||||||
@@ -176,11 +180,15 @@ export default function DetailRejectInvestasi({
|
|||||||
<Stack>
|
<Stack>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Dana Dibutuhkan</Text>
|
<Text>Dana Dibutuhkan</Text>
|
||||||
<Text>Rp. {investasi.targetDana}</Text>
|
<Text>Rp. {new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+investasi.targetDana)}</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Harga Per Lembar</Text>
|
<Text>Harga Per Lembar</Text>
|
||||||
<Text>Rp. {investasi.hargaLembar}</Text>
|
<Text>Rp. {new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+investasi.hargaLembar)}</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Jadwal Pembagian</Text>
|
<Text>Jadwal Pembagian</Text>
|
||||||
@@ -200,7 +208,9 @@ export default function DetailRejectInvestasi({
|
|||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Total Lembar</Text>
|
<Text>Total Lembar</Text>
|
||||||
<Text>{investasi.totalLembar} lembar</Text>
|
<Text>{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+investasi.totalLembar)} lembar</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Pembagian Deviden</Text>
|
<Text>Pembagian Deviden</Text>
|
||||||
@@ -211,14 +221,15 @@ export default function DetailRejectInvestasi({
|
|||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
{/* List Box */}
|
{/* List Box */}
|
||||||
{/* <Grid mb={"md"}>
|
<Grid mb={"md"}>
|
||||||
{listBox.map((e) => (
|
{listBox.map((e) => (
|
||||||
<Grid.Col
|
<Grid.Col
|
||||||
span={"auto"}
|
span={"auto"}
|
||||||
key={e.id}
|
key={e.id}
|
||||||
onClick={() => router.push(e.route + `${"1"}`)}
|
onClick={() => router.push(e.route + `${investasi.id}`)}
|
||||||
>
|
>
|
||||||
<Paper h={100} w={100} bg={"gray.4"} withBorder py={"xs"}>
|
<Center>
|
||||||
|
<Paper h={100} w={100} bg={"gray.4"} withBorder py={"xs"}>
|
||||||
<Flex direction={"column"} align={"center"} justify={"center"}>
|
<Flex direction={"column"} align={"center"} justify={"center"}>
|
||||||
<Text fz={12}>{e.name}</Text>
|
<Text fz={12}>{e.name}</Text>
|
||||||
<ActionIcon variant="transparent" size={60}>
|
<ActionIcon variant="transparent" size={60}>
|
||||||
@@ -226,9 +237,10 @@ export default function DetailRejectInvestasi({
|
|||||||
</ActionIcon>
|
</ActionIcon>
|
||||||
</Flex>
|
</Flex>
|
||||||
</Paper>
|
</Paper>
|
||||||
|
</Center>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
))}
|
))}
|
||||||
</Grid> */}
|
</Grid>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,11 +31,16 @@ import toast from "react-simple-toasts";
|
|||||||
import { MODEL_Investasi } from "../../model/model_investasi";
|
import { MODEL_Investasi } from "../../model/model_investasi";
|
||||||
import funGantiStatusInvestasi from "../../fun/fun_ganti_status";
|
import funGantiStatusInvestasi from "../../fun/fun_ganti_status";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
import _ from "lodash";
|
||||||
|
|
||||||
export default function DetailReviewInvestasi({dataInvestasi}:{dataInvestasi: MODEL_Investasi}) {
|
export default function DetailReviewInvestasi({
|
||||||
|
dataInvestasi,
|
||||||
|
}: {
|
||||||
|
dataInvestasi: MODEL_Investasi;
|
||||||
|
}) {
|
||||||
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 = [
|
||||||
{
|
{
|
||||||
@@ -50,12 +55,12 @@ export default function DetailReviewInvestasi({dataInvestasi}:{dataInvestasi: MO
|
|||||||
icon: <IconFileDescription size={70} />,
|
icon: <IconFileDescription size={70} />,
|
||||||
route: RouterInvestasi.detail_dokumen,
|
route: RouterInvestasi.detail_dokumen,
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
id: 3,
|
// id: 3,
|
||||||
name: "Berita",
|
// name: "Berita",
|
||||||
icon: <IconSpeakerphone size={70} />,
|
// icon: <IconSpeakerphone size={70} />,
|
||||||
route: RouterInvestasi.berita,
|
// route: RouterInvestasi.berita,
|
||||||
},
|
// },
|
||||||
];
|
];
|
||||||
|
|
||||||
async function onsubmit() {
|
async function onsubmit() {
|
||||||
@@ -76,7 +81,7 @@ export default function DetailReviewInvestasi({dataInvestasi}:{dataInvestasi: MO
|
|||||||
<>
|
<>
|
||||||
<Paper withBorder mb={"md"}>
|
<Paper withBorder mb={"md"}>
|
||||||
<AspectRatio ratio={16 / 9}>
|
<AspectRatio ratio={16 / 9}>
|
||||||
<Image
|
<Image
|
||||||
alt=""
|
alt=""
|
||||||
src={RouterInvestasi.api_gambar + `${investasi.imagesId}`}
|
src={RouterInvestasi.api_gambar + `${investasi.imagesId}`}
|
||||||
/>
|
/>
|
||||||
@@ -84,11 +89,11 @@ export default function DetailReviewInvestasi({dataInvestasi}:{dataInvestasi: MO
|
|||||||
</Paper>
|
</Paper>
|
||||||
|
|
||||||
{/* Title dan Persentase */}
|
{/* Title dan Persentase */}
|
||||||
<Box mb={"md"}>
|
<Center mb={"xs"}>
|
||||||
<Title order={4} mb={"xs"}>
|
<Title order={4} mb={"xs"}>
|
||||||
{investasi.title}
|
{_.capitalize(investasi.title)}
|
||||||
</Title>
|
</Title>
|
||||||
</Box>
|
</Center>
|
||||||
|
|
||||||
{/* Rincian Data */}
|
{/* Rincian Data */}
|
||||||
<Grid p={"md"} mb={"md"}>
|
<Grid p={"md"} mb={"md"}>
|
||||||
@@ -96,11 +101,15 @@ export default function DetailReviewInvestasi({dataInvestasi}:{dataInvestasi: MO
|
|||||||
<Stack>
|
<Stack>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Dana Dibutuhkan</Text>
|
<Text>Dana Dibutuhkan</Text>
|
||||||
<Text>Rp. {investasi.targetDana}</Text>
|
<Text>Rp. {new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 20,
|
||||||
|
}).format(+investasi.targetDana)}</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Harga Per Lembar</Text>
|
<Text>Harga Per Lembar</Text>
|
||||||
<Text>Rp. {investasi.hargaLembar}</Text>
|
<Text>Rp. {new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+investasi.hargaLembar)}</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Jadwal Pembagian</Text>
|
<Text>Jadwal Pembagian</Text>
|
||||||
@@ -120,7 +129,9 @@ export default function DetailReviewInvestasi({dataInvestasi}:{dataInvestasi: MO
|
|||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Total Lembar</Text>
|
<Text>Total Lembar</Text>
|
||||||
<Text>{investasi.totalLembar} lembar</Text>
|
<Text>{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+investasi.totalLembar)} lembar</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Pembagian Deviden</Text>
|
<Text>Pembagian Deviden</Text>
|
||||||
@@ -138,14 +149,16 @@ export default function DetailReviewInvestasi({dataInvestasi}:{dataInvestasi: MO
|
|||||||
key={e.id}
|
key={e.id}
|
||||||
onClick={() => router.push(e.route + `${investasi.id}`)}
|
onClick={() => router.push(e.route + `${investasi.id}`)}
|
||||||
>
|
>
|
||||||
<Paper h={100} w={100} bg={"gray.4"} withBorder py={"xs"}>
|
<Center>
|
||||||
<Flex direction={"column"} align={"center"} justify={"center"}>
|
<Paper h={100} w={100} bg={"gray.4"} withBorder py={"xs"}>
|
||||||
<Text fz={12}>{e.name}</Text>
|
<Flex direction={"column"} align={"center"} justify={"center"}>
|
||||||
<ActionIcon variant="transparent" size={60}>
|
<Text fz={12}>{e.name}</Text>
|
||||||
{e.icon}
|
<ActionIcon variant="transparent" size={60}>
|
||||||
</ActionIcon>
|
{e.icon}
|
||||||
</Flex>
|
</ActionIcon>
|
||||||
</Paper>
|
</Flex>
|
||||||
|
</Paper>
|
||||||
|
</Center>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
))}
|
))}
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -23,11 +23,11 @@ export default function EditInvestasi({id}:{id:string}) {
|
|||||||
name: "Dokumen",
|
name: "Dokumen",
|
||||||
route: RouterInvestasi.edit_dokumen,
|
route: RouterInvestasi.edit_dokumen,
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
id: 4,
|
// id: 4,
|
||||||
name: "Berita",
|
// name: "Berita",
|
||||||
route: RouterInvestasi.list_edit_berita,
|
// route: RouterInvestasi.list_edit_berita,
|
||||||
},
|
// },
|
||||||
];
|
];
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import {
|
|||||||
Stack,
|
Stack,
|
||||||
Modal,
|
Modal,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { IconCamera, IconChevronRight } from "@tabler/icons-react";
|
import { IconCamera, IconChevronRight, IconUpload } from "@tabler/icons-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
@@ -33,7 +33,6 @@ import { MODEL_DEFAULT_MASTER } from "@/app_modules/models/model_default_master"
|
|||||||
import funEditInvestasi from "../fun/fun_edit_investasi";
|
import funEditInvestasi from "../fun/fun_edit_investasi";
|
||||||
import { useDisclosure, useWindowScroll } from "@mantine/hooks";
|
import { useDisclosure, useWindowScroll } from "@mantine/hooks";
|
||||||
|
|
||||||
|
|
||||||
export default function EditIntroInvestasi({
|
export default function EditIntroInvestasi({
|
||||||
dataInvestasi,
|
dataInvestasi,
|
||||||
listPencarian,
|
listPencarian,
|
||||||
@@ -94,18 +93,20 @@ export default function EditIntroInvestasi({
|
|||||||
</Group>
|
</Group>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
<Box>
|
<Stack spacing={"xs"} px={"md"}>
|
||||||
<AspectRatio ratio={16 / 9}>
|
<AspectRatio ratio={16 / 9}>
|
||||||
{img ? (
|
<Paper withBorder radius={"md"}>
|
||||||
<Image alt="" src={img} />
|
{img ? (
|
||||||
) : (
|
<Image alt="" src={img} />
|
||||||
<Image
|
) : (
|
||||||
alt=""
|
<Image
|
||||||
src={RouterInvestasi.api_gambar + `${edit_inves.imagesId}`}
|
alt=""
|
||||||
/>
|
src={RouterInvestasi.api_gambar + `${edit_inves.imagesId}`}
|
||||||
)}
|
/>
|
||||||
|
)}
|
||||||
|
</Paper>
|
||||||
</AspectRatio>
|
</AspectRatio>
|
||||||
<Group position="center" mt={"md"}>
|
<Group position="center" mb={"md"}>
|
||||||
<FileButton
|
<FileButton
|
||||||
onChange={async (files: any) => {
|
onChange={async (files: any) => {
|
||||||
const buffer = URL.createObjectURL(
|
const buffer = URL.createObjectURL(
|
||||||
@@ -117,130 +118,134 @@ export default function EditIntroInvestasi({
|
|||||||
accept="image/png,image/jpeg"
|
accept="image/png,image/jpeg"
|
||||||
>
|
>
|
||||||
{(props) => (
|
{(props) => (
|
||||||
<Button {...props} radius={50}>
|
<Button
|
||||||
<IconCamera />
|
{...props}
|
||||||
|
radius={50}
|
||||||
|
leftIcon={<IconUpload size={12} />}
|
||||||
|
compact
|
||||||
|
bg={Warna.hijau_muda}
|
||||||
|
color="green"
|
||||||
|
>
|
||||||
|
Upload Gambar
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</FileButton>
|
</FileButton>
|
||||||
</Group>
|
</Group>
|
||||||
|
|
||||||
<Center>
|
<TextInput
|
||||||
<Box mt={"md"} w={350}>
|
label="Judul Proyek"
|
||||||
<TextInput
|
placeholder={"Masukan Judul"}
|
||||||
label="Judul Proyek"
|
value={edit_inves.title}
|
||||||
placeholder={"Masukan Judul"}
|
onChange={(val) => {
|
||||||
value={edit_inves.title}
|
setEdit_inves({
|
||||||
onChange={(val) => {
|
...edit_inves,
|
||||||
setEdit_inves({
|
title: val.target.value,
|
||||||
...edit_inves,
|
});
|
||||||
title: val.target.value,
|
}}
|
||||||
});
|
/>
|
||||||
}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<NumberInput
|
<NumberInput
|
||||||
label="Dana Dibutuhan"
|
label="Dana Dibutuhan"
|
||||||
type="number"
|
type="number"
|
||||||
value={+edit_inves.targetDana}
|
value={+edit_inves.targetDana}
|
||||||
onChange={(val) => {
|
onChange={(val) => {
|
||||||
setEdit_inves({
|
setEdit_inves({
|
||||||
...edit_inves,
|
...edit_inves,
|
||||||
targetDana: val as any,
|
targetDana: val as any,
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<NumberInput
|
<NumberInput
|
||||||
label="Harga Per Lember"
|
label="Harga Per Lember"
|
||||||
type="number"
|
type="number"
|
||||||
value={+edit_inves.hargaLembar}
|
value={+edit_inves.hargaLembar}
|
||||||
onChange={(val) => {
|
onChange={(val) => {
|
||||||
setEdit_inves({
|
setEdit_inves({
|
||||||
...edit_inves,
|
...edit_inves,
|
||||||
hargaLembar: val as any,
|
hargaLembar: val as any,
|
||||||
});
|
});
|
||||||
onTotalLembar(edit_inves.targetDana, val);
|
onTotalLembar(edit_inves.targetDana, val);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{/* Total Lembar */}
|
{/* Total Lembar */}
|
||||||
<Stack spacing={3}>
|
<Stack spacing={3}>
|
||||||
<Text fz={"sm"} fw={500}>
|
<Text fz={"sm"} fw={500}>
|
||||||
Total Lembar
|
Total Lembar
|
||||||
</Text>
|
</Text>
|
||||||
<Stack spacing={0}>
|
<Stack spacing={0}>
|
||||||
<Text>{totalLembar}</Text>
|
<Text>{totalLembar}</Text>
|
||||||
<Divider />
|
<Divider />
|
||||||
</Stack>
|
</Stack>
|
||||||
<Text c={"red"} fz={10}>
|
<Text c={"blue"} fz={10}>
|
||||||
*Total lembar dihitung dari, Target Dana : Harga Perlembar
|
*Total lembar dihitung dari, Target Dana : Harga Perlembar
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<NumberInput
|
<NumberInput
|
||||||
label="Rasio Keuntungan / ROI"
|
label="Rasio Keuntungan / ROI"
|
||||||
type="number"
|
type="number"
|
||||||
value={+edit_inves.roi}
|
value={+edit_inves.roi}
|
||||||
onChange={(val) => {
|
onChange={(val) => {
|
||||||
setEdit_inves({
|
setEdit_inves({
|
||||||
...edit_inves,
|
...edit_inves,
|
||||||
roi: val as any,
|
roi: val as any,
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
{/* Select Start */}
|
||||||
|
<Select
|
||||||
|
label="Pencarian Investor"
|
||||||
|
data={listPencarian.map((e) => ({
|
||||||
|
value: e.id,
|
||||||
|
label: e.name + " " + "hari",
|
||||||
|
}))}
|
||||||
|
value={edit_inves.MasterPencarianInvestor.id}
|
||||||
|
onChange={(val) => {
|
||||||
|
setEdit_inves({
|
||||||
|
...(edit_inves as any),
|
||||||
|
MasterPencarianInvestor: {
|
||||||
|
id: val,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Select
|
||||||
|
label="Periode Deviden"
|
||||||
|
data={listPeriode.map((e) => ({
|
||||||
|
value: e.id,
|
||||||
|
label: e.name,
|
||||||
|
}))}
|
||||||
|
value={edit_inves.MasterPeriodeDeviden.id}
|
||||||
|
onChange={(val) => {
|
||||||
|
setEdit_inves({
|
||||||
|
...(edit_inves as any),
|
||||||
|
MasterPeriodeDeviden: {
|
||||||
|
id: val,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<Select
|
||||||
|
label="Pembagian Deviden"
|
||||||
|
data={listPembagian.map((e) => ({
|
||||||
|
value: e.id,
|
||||||
|
label: e.name + " " + `${"bulan"}`,
|
||||||
|
}))}
|
||||||
|
value={edit_inves.MasterPembagianDeviden.id}
|
||||||
|
onChange={(val) => {
|
||||||
|
setEdit_inves({
|
||||||
|
...(edit_inves as any),
|
||||||
|
MasterPembagianDeviden: {
|
||||||
|
id: val,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
{/* Select End */}
|
||||||
|
|
||||||
{/* Select Start */}
|
|
||||||
<Select
|
|
||||||
label="Pencarian Investor"
|
|
||||||
data={listPencarian.map((e) => ({
|
|
||||||
value: e.id,
|
|
||||||
label: e.name + " " + "hari",
|
|
||||||
}))}
|
|
||||||
value={edit_inves.MasterPencarianInvestor.id}
|
|
||||||
onChange={(val) => {
|
|
||||||
setEdit_inves({
|
|
||||||
...(edit_inves as any),
|
|
||||||
MasterPencarianInvestor: {
|
|
||||||
id: val,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<Select
|
|
||||||
label="Periode Deviden"
|
|
||||||
data={listPeriode.map((e) => ({
|
|
||||||
value: e.id,
|
|
||||||
label: e.name,
|
|
||||||
}))}
|
|
||||||
value={edit_inves.MasterPeriodeDeviden.id}
|
|
||||||
onChange={(val) => {
|
|
||||||
setEdit_inves({
|
|
||||||
...(edit_inves as any),
|
|
||||||
MasterPeriodeDeviden: {
|
|
||||||
id: val,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<Select
|
|
||||||
label="Pembagian Deviden"
|
|
||||||
data={listPembagian.map((e) => ({
|
|
||||||
value: e.id,
|
|
||||||
label: e.name + " " + `${"bulan"}`,
|
|
||||||
}))}
|
|
||||||
value={edit_inves.MasterPembagianDeviden.id}
|
|
||||||
onChange={(val) => {
|
|
||||||
setEdit_inves({
|
|
||||||
...(edit_inves as any),
|
|
||||||
MasterPembagianDeviden: {
|
|
||||||
id: val,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
{/* Select End */}
|
|
||||||
</Box>
|
|
||||||
</Center>
|
|
||||||
<Center my={"lg"}>
|
<Center my={"lg"}>
|
||||||
<Button
|
<Button
|
||||||
w={200}
|
w={200}
|
||||||
@@ -255,7 +260,7 @@ export default function EditIntroInvestasi({
|
|||||||
Update
|
Update
|
||||||
</Button>
|
</Button>
|
||||||
</Center>
|
</Center>
|
||||||
</Box>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,21 +9,17 @@ import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
|||||||
import { MODEL_Investasi } from "../model/model_investasi";
|
import { MODEL_Investasi } from "../model/model_investasi";
|
||||||
|
|
||||||
export async function funCreateInvestasi(
|
export async function funCreateInvestasi(
|
||||||
formData: FormData,
|
gamabar: FormData,
|
||||||
|
filePdf: FormData,
|
||||||
data: MODEL_Investasi | any
|
data: MODEL_Investasi | any
|
||||||
) {
|
) {
|
||||||
|
// Function upload gambar
|
||||||
// return {
|
const file: any = gamabar.get("file");
|
||||||
// status: 201,
|
|
||||||
// message: "Berhasil Disimpan",
|
|
||||||
// };
|
|
||||||
|
|
||||||
const file: any = formData.get("file");
|
|
||||||
const fName = file.name;
|
const fName = file.name;
|
||||||
const fExt = _.lowerCase(file.name.split(".").pop());
|
const fExt = _.lowerCase(file.name.split(".").pop());
|
||||||
const fRandomName = v4(fName) + "." + fExt;
|
const fRandomName = v4(fName) + "." + fExt;
|
||||||
|
|
||||||
const upload = await prisma.images.create({
|
const uploadImage = await prisma.images.create({
|
||||||
data: {
|
data: {
|
||||||
url: fRandomName,
|
url: fRandomName,
|
||||||
},
|
},
|
||||||
@@ -33,16 +29,14 @@ export async function funCreateInvestasi(
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!upload)
|
if (!uploadImage)
|
||||||
return {
|
return {
|
||||||
status: 400,
|
status: 400,
|
||||||
message: "File Kosong",
|
message: "File Kosong",
|
||||||
};
|
};
|
||||||
|
|
||||||
const upFolder = Buffer.from(await file.arrayBuffer());
|
const upFolder = Buffer.from(await file.arrayBuffer());
|
||||||
fs.writeFileSync(`./public/investasi/${upload.url}`, upFolder);
|
fs.writeFileSync(`./public/investasi/${uploadImage.url}`, upFolder);
|
||||||
|
|
||||||
// console.log(data)
|
|
||||||
|
|
||||||
const createInvest = await prisma.investasi.create({
|
const createInvest = await prisma.investasi.create({
|
||||||
data: {
|
data: {
|
||||||
@@ -51,23 +45,46 @@ export async function funCreateInvestasi(
|
|||||||
targetDana: data.targetDana.toString(),
|
targetDana: data.targetDana.toString(),
|
||||||
hargaLembar: data.hargaLembar.toString(),
|
hargaLembar: data.hargaLembar.toString(),
|
||||||
totalLembar: data.totalLembar.toString(),
|
totalLembar: data.totalLembar.toString(),
|
||||||
sisaLembar: data.totalLembar.toString() ,
|
sisaLembar: data.totalLembar.toString(),
|
||||||
roi: data.roi.toString(),
|
roi: data.roi.toString(),
|
||||||
masterPembagianDevidenId: data.masterPeriodeDevidenId,
|
masterPembagianDevidenId: data.masterPeriodeDevidenId,
|
||||||
masterPeriodeDevidenId: data.masterPembagianDevidenId,
|
masterPeriodeDevidenId: data.masterPembagianDevidenId,
|
||||||
masterPencarianInvestorId: data.masterPencarianInvestorId,
|
masterPencarianInvestorId: data.masterPencarianInvestorId,
|
||||||
imagesId: upload.id,
|
imagesId: uploadImage.id,
|
||||||
masterStatusInvestasiId: "1",
|
masterStatusInvestasiId: "2",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
if (!createInvest)
|
if (!createInvest)
|
||||||
return {
|
return {
|
||||||
status: 400,
|
status: 400,
|
||||||
message: "Gagal Disimpan",
|
message: "Gagal Disimpan",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// File upload function
|
||||||
|
const dataPdf: any = filePdf.get("file");
|
||||||
|
const pdfName = dataPdf.name;
|
||||||
|
const pdfExt = _.lowerCase(dataPdf.name.split(".").pop());
|
||||||
|
const pdfRandomName = v4(pdfName) + "." + pdfExt;
|
||||||
|
|
||||||
|
const uploadFile = await prisma.prospektusInvestasi.upsert({
|
||||||
|
where: {
|
||||||
|
investasiId: createInvest.id,
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
url: pdfRandomName,
|
||||||
|
},
|
||||||
|
create: {
|
||||||
|
investasiId: createInvest.id,
|
||||||
|
url: pdfRandomName,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if(!uploadFile) return {status: 400, message: "Gagal Upload"}
|
||||||
|
const upPdfFolder = Buffer.from(await file.arrayBuffer())
|
||||||
|
fs.writeFileSync(`./public/file/${uploadFile.url}`, upPdfFolder)
|
||||||
|
|
||||||
|
|
||||||
revalidatePath(RouterInvestasi.main_porto);
|
revalidatePath(RouterInvestasi.main_porto);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -41,9 +41,9 @@ export default async function funEditInvestasi(
|
|||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
title: data.title,
|
title: data.title,
|
||||||
targetDana: data.targetDana,
|
targetDana: "" + data.targetDana,
|
||||||
hargaLembar: data.hargaLembar,
|
hargaLembar: "" + data.hargaLembar,
|
||||||
totalLembar: data.totalLembar,
|
totalLembar: "" + data.totalLembar,
|
||||||
roi: data.roi,
|
roi: data.roi,
|
||||||
masterPencarianInvestorId: data.MasterPencarianInvestor.id,
|
masterPencarianInvestorId: data.MasterPencarianInvestor.id,
|
||||||
masterPembagianDevidenId: data.MasterPembagianDeviden.id,
|
masterPembagianDevidenId: data.MasterPembagianDeviden.id,
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export default async function getPortoByStatusId(id: string, statusId: number) {
|
|||||||
title: true,
|
title: true,
|
||||||
imagesId: true,
|
imagesId: true,
|
||||||
// hargaLembar: true,
|
// hargaLembar: true,
|
||||||
// targetDana: true,
|
targetDana: true,
|
||||||
// totalLembar: true,
|
// totalLembar: true,
|
||||||
// roi: true,
|
// roi: true,
|
||||||
// active: true,
|
// active: true,
|
||||||
@@ -53,6 +53,7 @@ export default async function getPortoByStatusId(id: string, statusId: number) {
|
|||||||
id: true,
|
id: true,
|
||||||
title: true,
|
title: true,
|
||||||
imagesId: true,
|
imagesId: true,
|
||||||
|
targetDana: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return data;
|
return data;
|
||||||
@@ -75,6 +76,7 @@ export default async function getPortoByStatusId(id: string, statusId: number) {
|
|||||||
title: true,
|
title: true,
|
||||||
imagesId: true,
|
imagesId: true,
|
||||||
updatedAt: true,
|
updatedAt: true,
|
||||||
|
targetDana: true,
|
||||||
MasterPencarianInvestor: true,
|
MasterPencarianInvestor: true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -97,6 +99,7 @@ export default async function getPortoByStatusId(id: string, statusId: number) {
|
|||||||
id: true,
|
id: true,
|
||||||
title: true,
|
title: true,
|
||||||
imagesId: true,
|
imagesId: true,
|
||||||
|
targetDana: true
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
return data;
|
return data;
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ export default function LayoutMainInvestasi({
|
|||||||
<HeaderTamplate
|
<HeaderTamplate
|
||||||
route="/dev/crowd/main"
|
route="/dev/crowd/main"
|
||||||
title="Investasi"
|
title="Investasi"
|
||||||
icon={<IconPencilPlus />}
|
// icon={<IconPencilPlus />}
|
||||||
route2={"/dev/investasi/create"}
|
// route2={"/dev/investasi/create"}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
footer={
|
footer={
|
||||||
|
|||||||
@@ -45,7 +45,6 @@ export default function MainInvestasi({
|
|||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [investasi, setInvestasi] = useState(listData);
|
const [investasi, setInvestasi] = useState(listData);
|
||||||
|
|
||||||
|
|
||||||
if (_.isEmpty(investasi))
|
if (_.isEmpty(investasi))
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -62,9 +61,11 @@ export default function MainInvestasi({
|
|||||||
|
|
||||||
{investasi.map((e) => (
|
{investasi.map((e) => (
|
||||||
<Card
|
<Card
|
||||||
|
// sx={{ borderStyle: "solid", borderColor: "black", borderWidth: "0.5px" }}
|
||||||
|
|
||||||
key={e.id}
|
key={e.id}
|
||||||
withBorder
|
|
||||||
mb={"lg"}
|
mb={"lg"}
|
||||||
|
bg={"teal"}
|
||||||
onClick={() => router.push(`/dev/investasi/detail/${e.id}`)}
|
onClick={() => router.push(`/dev/investasi/detail/${e.id}`)}
|
||||||
>
|
>
|
||||||
<CardSection p={"xs"}>
|
<CardSection p={"xs"}>
|
||||||
@@ -98,11 +99,18 @@ export default function MainInvestasi({
|
|||||||
<Stack>
|
<Stack>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Dana Dibutuhkan</Text>
|
<Text>Dana Dibutuhkan</Text>
|
||||||
<Text>Rp. {e.targetDana}</Text>
|
<Text>Rp. {new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+e.targetDana)}</Text>
|
||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Harga Per Lembar</Text>
|
<Text>Harga Per Lembar</Text>
|
||||||
<Text>Rp. {e.hargaLembar}</Text>
|
<Text>
|
||||||
|
Rp. {new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+e.hargaLembar)}
|
||||||
|
{/* {e.hargaLembar} */}
|
||||||
|
</Text>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
@@ -114,7 +122,7 @@ export default function MainInvestasi({
|
|||||||
</Box>
|
</Box>
|
||||||
<Box>
|
<Box>
|
||||||
<Text>Total Lembar</Text>
|
<Text>Total Lembar</Text>
|
||||||
<Text>{e.totalLembar}</Text>
|
<Text>{new Intl.NumberFormat("id-ID").format(+e.totalLembar)}</Text>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
|
|||||||
@@ -11,6 +11,10 @@ import {
|
|||||||
Image,
|
Image,
|
||||||
Text,
|
Text,
|
||||||
Center,
|
Center,
|
||||||
|
Paper,
|
||||||
|
Grid,
|
||||||
|
Flex,
|
||||||
|
Stack,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { MODEL_Investasi } from "../model/model_investasi";
|
import { MODEL_Investasi } from "../model/model_investasi";
|
||||||
@@ -18,53 +22,55 @@ import _ from "lodash";
|
|||||||
|
|
||||||
export default function Draft({ data }: { data: MODEL_Investasi[] }) {
|
export default function Draft({ data }: { data: MODEL_Investasi[] }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
// console.log(data)
|
||||||
|
|
||||||
if (_.isEmpty(data))
|
if (_.isEmpty(data))
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Center h={"50vh"}>Tidak ada Draft</Center>
|
<Center h={"50vh"}>Tidak ada Draft</Center>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <pre> {JSON.stringify(data,null, 2)}</pre> */}
|
{/* <pre> {JSON.stringify(data,null, 2)}</pre> */}
|
||||||
{data.map((e) =>
|
{data.map((e) => (
|
||||||
<Card
|
<Paper
|
||||||
key={e.id}
|
// sx={{ borderStyle: "solid", borderColor: "yellow", borderWidth: "0.5px" }}
|
||||||
withBorder
|
p={"xs"}
|
||||||
mb={40}
|
key={e.id}
|
||||||
bg={"gray.5"}
|
mb={"md"}
|
||||||
onClick={() =>
|
bg={"yellow.1"}
|
||||||
router.push(RouterInvestasi.detail_draft + `${e.id}`)
|
withBorder
|
||||||
}
|
onClick={() => router.push(RouterInvestasi.detail_draft + `${e.id}`)}
|
||||||
>
|
>
|
||||||
<CardSection p={"xs"}>
|
<Grid>
|
||||||
<AspectRatio ratio={16 / 9}>
|
<Grid.Col span={8}>
|
||||||
<Image
|
<Text fw={"bold"}> {_.capitalize(e.title)}</Text>
|
||||||
alt=""
|
<Stack spacing={0}>
|
||||||
src={RouterInvestasi.api_gambar + `${e.imagesId}`}
|
<Text fz={10}>Target Dana:</Text>
|
||||||
/>
|
<Text>
|
||||||
</AspectRatio>
|
Rp.{" "}
|
||||||
</CardSection>
|
{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+e.targetDana)}
|
||||||
|
</Text>
|
||||||
|
</Stack>
|
||||||
|
</Grid.Col>
|
||||||
|
|
||||||
<CardSection p={"lg"}>
|
<Grid.Col span={4}>
|
||||||
<Box>
|
<AspectRatio ratio={16 / 9}>
|
||||||
<Title order={4}>{e.title}</Title>
|
<Paper radius={"md"}>
|
||||||
</Box>
|
<Image
|
||||||
</CardSection>
|
alt=""
|
||||||
<Divider />
|
src={RouterInvestasi.api_gambar + `${e.imagesId}`}
|
||||||
<CardSection p={"md"}>
|
/>
|
||||||
<Group position="center">
|
</Paper>
|
||||||
<Badge color="yellow" variant="dot">
|
</AspectRatio>
|
||||||
Draft
|
</Grid.Col>
|
||||||
</Badge>
|
</Grid>
|
||||||
</Group>
|
</Paper>
|
||||||
</CardSection>
|
))}
|
||||||
</Card>
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ import {
|
|||||||
Image,
|
Image,
|
||||||
Text,
|
Text,
|
||||||
Center,
|
Center,
|
||||||
|
Grid,
|
||||||
|
Stack,
|
||||||
|
Paper,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import {
|
import {
|
||||||
@@ -36,38 +39,43 @@ export default function Publish({ data }: { data: MODEL_Investasi[] }) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{data.map((e) => (
|
{data.map((e) => (
|
||||||
<Card
|
<Paper
|
||||||
key={e.id}
|
key={e.id}
|
||||||
withBorder
|
withBorder
|
||||||
mb={40}
|
mb={"md"}
|
||||||
bg={"gray.5"}
|
p={"xs"}
|
||||||
|
bg={"green.1"}
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
router.push(RouterInvestasi.detail_publish + `${e.id}`)
|
router.push(RouterInvestasi.detail_publish + `${e.id}`)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<CardSection p={"xs"}>
|
<Grid>
|
||||||
<AspectRatio ratio={16 / 9}>
|
<Grid.Col span={8}>
|
||||||
<Image
|
<Text fw={"bold"}> {_.capitalize(e.title)}</Text>
|
||||||
alt=""
|
<Stack spacing={0}>
|
||||||
src={RouterInvestasi.api_gambar + `${e.imagesId}`}
|
<Text fz={10}>Target Dana:</Text>
|
||||||
/>
|
<Text>
|
||||||
</AspectRatio>
|
Rp.{" "}
|
||||||
</CardSection>
|
{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+e.targetDana)}
|
||||||
|
</Text>
|
||||||
|
</Stack>
|
||||||
|
</Grid.Col>
|
||||||
|
|
||||||
<CardSection p={"lg"}>
|
<Grid.Col span={4}>
|
||||||
<Box mb={"md"}>
|
<AspectRatio ratio={16 / 9}>
|
||||||
<Title order={4}>{e.title}</Title>
|
<Paper radius={"md"}>
|
||||||
{/* <Slider
|
<Image
|
||||||
size={10}
|
alt=""
|
||||||
disabled
|
src={RouterInvestasi.api_gambar + `${e.imagesId}`}
|
||||||
labelAlwaysOn
|
/>
|
||||||
value={60}
|
</Paper>
|
||||||
marks={[{ value: 60, label: 60 + `%` }]}
|
</AspectRatio>
|
||||||
/> */}
|
</Grid.Col>
|
||||||
</Box>
|
</Grid>
|
||||||
</CardSection>
|
<Divider my={"xs"}/>
|
||||||
<Divider />
|
<Group position="center">
|
||||||
<CardSection p={"md"}>
|
|
||||||
{Number(e.MasterPencarianInvestor.name) -
|
{Number(e.MasterPencarianInvestor.name) -
|
||||||
moment(new Date()).diff(new Date(e.updatedAt), "days") <=
|
moment(new Date()).diff(new Date(e.updatedAt), "days") <=
|
||||||
0 ? (
|
0 ? (
|
||||||
@@ -76,10 +84,10 @@ export default function Publish({ data }: { data: MODEL_Investasi[] }) {
|
|||||||
<Text c={"green"}>Selesai</Text>
|
<Text c={"green"}>Selesai</Text>
|
||||||
</Group>
|
</Group>
|
||||||
) : (
|
) : (
|
||||||
<Group position="apart">
|
<Group position="center">
|
||||||
<Badge color="green" variant="dot">
|
{/* <Badge color="green" variant="dot">
|
||||||
Publish
|
Publish
|
||||||
</Badge>
|
</Badge> */}
|
||||||
<Text>
|
<Text>
|
||||||
Sisa Waktu :{" "}
|
Sisa Waktu :{" "}
|
||||||
{Number(e.MasterPencarianInvestor.name) -
|
{Number(e.MasterPencarianInvestor.name) -
|
||||||
@@ -88,8 +96,8 @@ export default function Publish({ data }: { data: MODEL_Investasi[] }) {
|
|||||||
</Text>
|
</Text>
|
||||||
</Group>
|
</Group>
|
||||||
)}
|
)}
|
||||||
</CardSection>
|
</Group>
|
||||||
</Card>
|
</Paper>
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ import {
|
|||||||
Image,
|
Image,
|
||||||
Text,
|
Text,
|
||||||
Center,
|
Center,
|
||||||
|
Grid,
|
||||||
|
Stack,
|
||||||
|
Paper,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import {
|
import {
|
||||||
@@ -35,36 +38,39 @@ export default function Reject({ data }: { data: MODEL_Investasi[] }) {
|
|||||||
<>
|
<>
|
||||||
|
|
||||||
{investasi.map((e) => (
|
{investasi.map((e) => (
|
||||||
<Card
|
<Paper
|
||||||
key={e.id}
|
key={e.id}
|
||||||
withBorder
|
withBorder
|
||||||
mb={40}
|
mb={"md"}
|
||||||
bg={"gray.5"}
|
p={"xs"}
|
||||||
|
bg={"red.1"}
|
||||||
onClick={() => router.push(RouterInvestasi.detail_reject + `${e.id}`)}
|
onClick={() => router.push(RouterInvestasi.detail_reject + `${e.id}`)}
|
||||||
>
|
>
|
||||||
<CardSection p={"xs"}>
|
<Grid>
|
||||||
<AspectRatio ratio={16 / 9}>
|
<Grid.Col span={8}>
|
||||||
<Image
|
<Text fw={"bold"}> {_.capitalize(e.title)}</Text>
|
||||||
alt=""
|
<Stack spacing={0}>
|
||||||
src={RouterInvestasi.api_gambar + `${e.imagesId}`}
|
<Text fz={10}>Target Dana:</Text>
|
||||||
/>
|
<Text>
|
||||||
</AspectRatio>
|
Rp. {new Intl.NumberFormat("id-ID", {
|
||||||
</CardSection>
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+e.targetDana)}
|
||||||
|
</Text>
|
||||||
|
</Stack>
|
||||||
|
</Grid.Col>
|
||||||
|
|
||||||
<CardSection p={"lg"}>
|
<Grid.Col span={4}>
|
||||||
<Box>
|
<AspectRatio ratio={16 / 9}>
|
||||||
<Title order={4}>{e.title}</Title>
|
<Paper radius={"md"}>
|
||||||
</Box>
|
<Image
|
||||||
</CardSection>
|
alt=""
|
||||||
<Divider />
|
src={RouterInvestasi.api_gambar + `${e.imagesId}`}
|
||||||
<CardSection p={"md"}>
|
/>
|
||||||
<Group position="center">
|
</Paper>
|
||||||
<Badge color="red" variant="dot">
|
</AspectRatio>
|
||||||
Reject
|
</Grid.Col>
|
||||||
</Badge>
|
</Grid>
|
||||||
</Group>
|
</Paper>
|
||||||
</CardSection>
|
|
||||||
</Card>
|
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ import {
|
|||||||
Image,
|
Image,
|
||||||
Center,
|
Center,
|
||||||
Text,
|
Text,
|
||||||
|
Paper,
|
||||||
|
Grid,
|
||||||
|
Stack,
|
||||||
} from "@mantine/core";
|
} from "@mantine/core";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import {
|
import {
|
||||||
@@ -31,36 +34,41 @@ export default function Review({ data }: { data: MODEL_Investasi[] }) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{data.map((e) => (
|
{data.map((e) => (
|
||||||
<Card
|
<Paper
|
||||||
|
// sx={{ borderStyle: "solid", borderColor: "orange", borderWidth: "1px" }}
|
||||||
key={e.id}
|
key={e.id}
|
||||||
|
mb={"md"}
|
||||||
|
bg={"orange.1"}
|
||||||
|
p={"xs"}
|
||||||
withBorder
|
withBorder
|
||||||
mb={40}
|
|
||||||
bg={"gray.5"}
|
|
||||||
onClick={() => router.push(RouterInvestasi.detail_review + `${e.id}`)}
|
onClick={() => router.push(RouterInvestasi.detail_review + `${e.id}`)}
|
||||||
>
|
>
|
||||||
<CardSection p={"xs"}>
|
<Grid>
|
||||||
<AspectRatio ratio={16 / 9}>
|
<Grid.Col span={8}>
|
||||||
<Image
|
<Text fw={"bold"}> {_.capitalize(e.title)}</Text>
|
||||||
alt=""
|
<Stack spacing={0}>
|
||||||
src={RouterInvestasi.api_gambar + `${e.imagesId}`}
|
<Text fz={10}>Target Dana:</Text>
|
||||||
/>
|
<Text>
|
||||||
</AspectRatio>
|
Rp.{" "}
|
||||||
</CardSection>
|
{new Intl.NumberFormat("id-ID", {
|
||||||
|
maximumSignificantDigits: 10,
|
||||||
|
}).format(+e.targetDana)}
|
||||||
|
</Text>
|
||||||
|
</Stack>
|
||||||
|
</Grid.Col>
|
||||||
|
|
||||||
<CardSection p={"lg"}>
|
<Grid.Col span={4}>
|
||||||
<Box>
|
<AspectRatio ratio={16 / 9}>
|
||||||
<Title order={4}>{e.title}</Title>
|
<Paper radius={"md"}>
|
||||||
</Box>
|
<Image
|
||||||
</CardSection>
|
alt=""
|
||||||
<Divider />
|
src={RouterInvestasi.api_gambar + `${e.imagesId}`}
|
||||||
<CardSection p={"md"}>
|
/>
|
||||||
<Group position="center">
|
</Paper>
|
||||||
<Badge color="yellow" variant="dot">
|
</AspectRatio>
|
||||||
Review
|
</Grid.Col>
|
||||||
</Badge>
|
</Grid>
|
||||||
</Group>
|
</Paper>
|
||||||
</CardSection>
|
|
||||||
</Card>
|
|
||||||
))}
|
))}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -26,7 +26,11 @@ import {
|
|||||||
import dataDummy from "../dummy/data_dummy.json";
|
import dataDummy from "../dummy/data_dummy.json";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { IconCaretDown, IconCircleCheck } from "@tabler/icons-react";
|
import {
|
||||||
|
IconCaretDown,
|
||||||
|
IconCircleCheck,
|
||||||
|
IconCirclePlus,
|
||||||
|
} from "@tabler/icons-react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
import "react-responsive-carousel/lib/styles/carousel.min.css"; // requires a loader
|
import "react-responsive-carousel/lib/styles/carousel.min.css"; // requires a loader
|
||||||
@@ -73,38 +77,49 @@ export default function PortofolioInvestasi({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <pre>{JSON.stringify(dataInvestasi, null, 2)}</pre> */}
|
{/* <pre>{JSON.stringify(dataInvestasi, null, 2)}</pre> */}
|
||||||
<Tabs
|
<Stack>
|
||||||
variant="pills"
|
<Button
|
||||||
radius="xl"
|
radius={"xl"}
|
||||||
defaultValue="Draft"
|
bg={Warna.biru}
|
||||||
value={activeTab}
|
color="blue"
|
||||||
onTabChange={setActiveTab}
|
leftIcon={<IconCirclePlus />}
|
||||||
>
|
onClick={() => router.push(RouterInvestasi.create)}
|
||||||
<Tabs.List>
|
>
|
||||||
{status_inves.map((e) => (
|
Buat Proyek Invetasi
|
||||||
<Tabs.Tab
|
</Button>
|
||||||
key={e.id}
|
<Tabs
|
||||||
value={e.name}
|
variant="pills"
|
||||||
color={!activeTab ? "gray" : e.color}
|
radius="xl"
|
||||||
>
|
defaultValue="Draft"
|
||||||
{e.name}
|
value={activeTab}
|
||||||
</Tabs.Tab>
|
onTabChange={setActiveTab}
|
||||||
))}
|
>
|
||||||
</Tabs.List>
|
<Tabs.List grow>
|
||||||
<Divider my={"xs"} />
|
{status_inves.map((e) => (
|
||||||
<Tabs.Panel key={"1"} value="Draft">
|
<Tabs.Tab
|
||||||
<Draft data={dataDraft as any} />
|
key={e.id}
|
||||||
</Tabs.Panel>
|
value={e.name}
|
||||||
<Tabs.Panel key={"2"} value="Review">
|
color={!activeTab ? "gray" : e.color}
|
||||||
<Review data={dataReview as any} />
|
>
|
||||||
</Tabs.Panel>
|
{e.name}
|
||||||
<Tabs.Panel key={"3"} value="Publish">
|
</Tabs.Tab>
|
||||||
<Publish data={dataPublish as any} />
|
))}
|
||||||
</Tabs.Panel>
|
</Tabs.List>
|
||||||
<Tabs.Panel key={"4"} value="Reject">
|
<Divider my={"xs"} />
|
||||||
<Reject data={dataReject as any} />
|
<Tabs.Panel key={"1"} value="Draft">
|
||||||
</Tabs.Panel>
|
<Draft data={dataDraft as any} />
|
||||||
</Tabs>
|
</Tabs.Panel>
|
||||||
|
<Tabs.Panel key={"2"} value="Review">
|
||||||
|
<Review data={dataReview as any} />
|
||||||
|
</Tabs.Panel>
|
||||||
|
<Tabs.Panel key={"3"} value="Publish">
|
||||||
|
<Publish data={dataPublish as any} />
|
||||||
|
</Tabs.Panel>
|
||||||
|
<Tabs.Panel key={"4"} value="Reject">
|
||||||
|
<Reject data={dataReject as any} />
|
||||||
|
</Tabs.Panel>
|
||||||
|
</Tabs>
|
||||||
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||||
import { Badge, Group, Paper, Stack, Text, Title } from "@mantine/core";
|
import { Badge, Center, Group, Paper, Stack, Text, Title } from "@mantine/core";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import toast from "react-simple-toasts";
|
import toast from "react-simple-toasts";
|
||||||
import {
|
import {
|
||||||
@@ -13,6 +13,7 @@ import moment from "moment";
|
|||||||
import funCountDown from "../fun/fun_countdown_investasi";
|
import funCountDown from "../fun/fun_countdown_investasi";
|
||||||
import funGantiStatusTransaksi_Investasi from "../fun/fun_ganti_status_transaksi";
|
import funGantiStatusTransaksi_Investasi from "../fun/fun_ganti_status_transaksi";
|
||||||
import { useInterval, useShallowEffect } from "@mantine/hooks";
|
import { useInterval, useShallowEffect } from "@mantine/hooks";
|
||||||
|
import _ from "lodash";
|
||||||
|
|
||||||
export default function TransaksiInvestasi({
|
export default function TransaksiInvestasi({
|
||||||
statusTransaksi,
|
statusTransaksi,
|
||||||
@@ -45,6 +46,12 @@ export default function TransaksiInvestasi({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(_.isEmpty(transaksi))
|
||||||
|
return <>
|
||||||
|
<Center h={"80vh"}>
|
||||||
|
<Title order={5}>Tidak Ada Transaksi</Title>
|
||||||
|
</Center>
|
||||||
|
</>
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||