Revisi tampilan
fix: - alur pembuatan investasi - tampilan investasi ### No issue
@@ -129,7 +129,7 @@ model Investasi {
|
||||
ProspektusInvestasi ProspektusInvestasi?
|
||||
|
||||
MasterStatusInvestasi MasterStatusInvestasi? @relation(fields: [masterStatusInvestasiId], references: [id])
|
||||
masterStatusInvestasiId String? @default("1")
|
||||
masterStatusInvestasiId String? @default("2")
|
||||
BeritaInvestasi BeritaInvestasi[]
|
||||
DokumenInvestasi DokumenInvestasi[]
|
||||
|
||||
@@ -175,13 +175,13 @@ model MasterStatusInvestasi {
|
||||
}
|
||||
|
||||
model ProspektusInvestasi {
|
||||
id String @id @default(cuid())
|
||||
id String @id @default(cuid())
|
||||
url String
|
||||
active Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @default(now()) @updatedAt
|
||||
investasi Investasi @relation(fields: [investasiId], references: [id])
|
||||
investasiId String @unique
|
||||
active Boolean @default(true)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @default(now()) @updatedAt
|
||||
investasi Investasi? @relation(fields: [investasiId], references: [id])
|
||||
investasiId String? @unique
|
||||
}
|
||||
|
||||
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_CountStatusInvestasi from "@/app_modules/admin/investasi/fun/count_status";
|
||||
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() {
|
||||
const listInvestasi = await Admin_funGetAllInvestasi();
|
||||
@@ -8,6 +9,8 @@ export default async function Page() {
|
||||
const countReview = await Admin_CountStatusInvestasi(2);
|
||||
const countPublish = await Admin_CountStatusInvestasi(3);
|
||||
const countReject = await Admin_CountStatusInvestasi(4);
|
||||
const totalInvestasiByUser = await Admin_getTotalInvestasiByUser()
|
||||
// console.log(totalInvestasi)
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -17,8 +20,10 @@ export default async function Page() {
|
||||
countReview={countReview}
|
||||
countPublish={countPublish}
|
||||
countReject={countReject}
|
||||
totalInvestasiByUser={totalInvestasiByUser}
|
||||
|
||||
/>
|
||||
{/* <pre>{JSON.stringify(totalInvestasiByUser, null,2)}</pre> */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ export const RouterInvestasi = {
|
||||
|
||||
//INVESTASI
|
||||
main: "/dev/investasi/main",
|
||||
create: "/dev/investasi/create",
|
||||
main_porto: "/dev/investasi/main/portofolio",
|
||||
main_investasi: "/dev/investasi/main/saham_saya",
|
||||
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 { revalidatePath } from "next/cache"
|
||||
|
||||
export default async function funRejectInvestasi(data: any) {
|
||||
export default async function Admin_funRejectInvestasi(data: any) {
|
||||
// console.log(data)
|
||||
|
||||
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 { useState } from "react";
|
||||
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({
|
||||
dataInvestasi,
|
||||
@@ -105,7 +105,7 @@ export default function Admin_KonfirmasiInvestasi({
|
||||
status: "4",
|
||||
};
|
||||
if (_.isEmpty(body.catatan)) return toast("Lengkapi alasan");
|
||||
await funRejectInvestasi(body).then((res) => {
|
||||
await Admin_funRejectInvestasi(body).then((res) => {
|
||||
if (res.status === 200) {
|
||||
toast(res.message);
|
||||
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 {
|
||||
ActionIcon,
|
||||
Avatar,
|
||||
Badge,
|
||||
Box,
|
||||
Center,
|
||||
Divider,
|
||||
Grid,
|
||||
Group,
|
||||
Paper,
|
||||
ScrollArea,
|
||||
Stack,
|
||||
@@ -29,12 +31,14 @@ export default function Admin_Investasi({
|
||||
countReview,
|
||||
countPublish,
|
||||
countReject,
|
||||
totalInvestasiByUser,
|
||||
}: {
|
||||
listInvestasi: MODEL_Investasi[];
|
||||
countDraft: number | any;
|
||||
countReview: number | any;
|
||||
countPublish: number | any;
|
||||
countReject: number | any;
|
||||
totalInvestasiByUser: any[];
|
||||
}) {
|
||||
const [investasi, setInvestasi] = useState(listInvestasi);
|
||||
const router = useRouter();
|
||||
@@ -44,21 +48,28 @@ export default function Admin_Investasi({
|
||||
id: 1,
|
||||
name: "Draft",
|
||||
jumlah: countDraft,
|
||||
color: "yellow"
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: "Review",
|
||||
jumlah: countReview,
|
||||
color: "orange"
|
||||
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "Publish",
|
||||
jumlah: countPublish,
|
||||
color: "green"
|
||||
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: "Reject",
|
||||
jumlah: countReject,
|
||||
color: "red"
|
||||
|
||||
},
|
||||
];
|
||||
|
||||
@@ -69,7 +80,12 @@ export default function Admin_Investasi({
|
||||
<Grid mb={"md"}>
|
||||
{listBox.map((e) => (
|
||||
<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>
|
||||
<Stack spacing={0}>
|
||||
<Text>{e.name}</Text>
|
||||
@@ -84,16 +100,29 @@ export default function Admin_Investasi({
|
||||
</Grid.Col>
|
||||
))}
|
||||
</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} />
|
||||
<TableReject dataInvestsi={investasi as any} />
|
||||
{/* <pre>{JSON.stringify(investasi, null, 2)}</pre> */}
|
||||
<TableReject dataInvestsi={investasi as any} /> */}
|
||||
{/* <pre>{JSON.stringify(totalInvestasiByUser, null, 2)}</pre> */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,22 +1,30 @@
|
||||
"use client";
|
||||
|
||||
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 { useRouter } from "next/navigation";
|
||||
|
||||
export default function SplashDashboardAdmin() {
|
||||
const router = useRouter()
|
||||
useShallowEffect(() => {
|
||||
setTimeout(() => router.push(RouterAdminDashboard.main_admin), 2000)
|
||||
},[])
|
||||
const router = useRouter();
|
||||
useShallowEffect(() => {
|
||||
setTimeout(() => router.push(RouterAdminDashboard.main_admin), 2000)
|
||||
}, []);
|
||||
return (
|
||||
<>
|
||||
<Stack align="center" justify="center" h={"100vh"}>
|
||||
<Title order={4} c={"orange"}>Selamat Datang, ADMIN</Title>
|
||||
{/* <Stack align="center" justify="center" h={"100vh"}>
|
||||
<Title order={4} c={"orange"}>
|
||||
Selamat Datang, ADMIN
|
||||
</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";
|
||||
|
||||
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 { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
@@ -22,9 +32,19 @@ export default function SplashScreen({ data }: { data: any }) {
|
||||
}, []);
|
||||
return (
|
||||
<>
|
||||
<Flex justify={"center"} align={"center"} h={"100vh"}>
|
||||
<Title order={1}>Splash Screen</Title>
|
||||
</Flex>
|
||||
<Center h={"100vh"}>
|
||||
<Stack align="center" justify="center" p={"md"}>
|
||||
{/* <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"}
|
||||
align={"center"}
|
||||
>
|
||||
<Text>Enter the 6-digit OTP , we’ve just sent</Text>
|
||||
<Text>to {nomor}</Text>
|
||||
<Text>Enter the 4-digit OTP , we’ve just sent</Text>
|
||||
<Text>to +{nomor}</Text>
|
||||
</Flex>
|
||||
<PinInput
|
||||
ref={focusTrapRef}
|
||||
|
||||
@@ -6,12 +6,15 @@ import {
|
||||
AspectRatio,
|
||||
Button,
|
||||
Center,
|
||||
Flex,
|
||||
Grid,
|
||||
Image,
|
||||
Paper,
|
||||
Stack,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { IconChevronRight } from "@tabler/icons-react";
|
||||
import { useAtom } from "jotai";
|
||||
import { useRouter } from "next/navigation";
|
||||
import toast from "react-simple-toasts";
|
||||
@@ -22,32 +25,57 @@ export default function MainCrowd() {
|
||||
return (
|
||||
<>
|
||||
<Stack>
|
||||
<Paper bg={"gray"}>
|
||||
<Paper>
|
||||
<AspectRatio ratio={16 / 9}>
|
||||
<Image alt="" src={"/aset/logo.png"} />
|
||||
<Paper radius={"md"}>
|
||||
<Image alt="" src={"/aset/investasi/logo-crowd-panjang.png"} />
|
||||
</Paper>
|
||||
</AspectRatio>
|
||||
</Paper>
|
||||
<Stack align="center">
|
||||
<Button
|
||||
w={300}
|
||||
radius={50}
|
||||
bg={Warna.hijau_tua}
|
||||
color="green"
|
||||
<Stack>
|
||||
<Paper
|
||||
p={"xs"}
|
||||
radius={"md"}
|
||||
bg={"teal"}
|
||||
onClick={() => {
|
||||
router.push("/dev/investasi/main");
|
||||
setChangeColor(0);
|
||||
}}
|
||||
>
|
||||
Investasi
|
||||
</Button>
|
||||
<Button
|
||||
w={300}
|
||||
<Grid>
|
||||
<Grid.Col span={10}>
|
||||
<Title order={4}> Investasi</Title>
|
||||
<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}
|
||||
radius={50}
|
||||
radius={"md"}
|
||||
p={"xs"}
|
||||
onClick={() => toast("Cooming Soon Feature...")}
|
||||
>
|
||||
Donasi
|
||||
</Button>
|
||||
<Grid>
|
||||
<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>
|
||||
</>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"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 { useRouter } from "next/navigation";
|
||||
|
||||
@@ -14,9 +15,8 @@ export default function SplashCrowd() {
|
||||
<>
|
||||
<Center h={"100vh"}>
|
||||
<Stack align="center" justify="center">
|
||||
<Text>Welcome to,</Text>
|
||||
<Title>HIPMI</Title>
|
||||
<Title order={3}>CrowdFunding</Title>
|
||||
<Title c={"#002e59"}>Welcome to</Title>
|
||||
<Image alt="" src={"/aset/investasi/logo-crowd.png"} />
|
||||
</Stack>
|
||||
</Center>
|
||||
</>
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
Paper,
|
||||
SimpleGrid,
|
||||
Text,
|
||||
ThemeIcon,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { Logout } from "../auth";
|
||||
@@ -153,7 +154,7 @@ export default function HomeView({ user }: { user: MODEL_User_profile }) {
|
||||
// }
|
||||
// }
|
||||
if (e.link === "") {
|
||||
toast(e.name);
|
||||
toast("Cooming Soon !!");
|
||||
} else {
|
||||
return router.push(e.link);
|
||||
}
|
||||
@@ -165,8 +166,14 @@ export default function HomeView({ user }: { user: MODEL_User_profile }) {
|
||||
direction={"column"}
|
||||
h={100}
|
||||
>
|
||||
{e.icon}
|
||||
{e.name}
|
||||
<ActionIcon
|
||||
size={50}
|
||||
variant="transparent"
|
||||
color={e.link === "" ? "gray" : "teal"}
|
||||
>
|
||||
{e.icon}
|
||||
</ActionIcon>
|
||||
<Text c={e.link === "" ? "gray" : "teal"}>{e.name}</Text>
|
||||
</Flex>
|
||||
</Paper>
|
||||
))}
|
||||
|
||||
@@ -13,12 +13,13 @@ import {
|
||||
Group,
|
||||
Image,
|
||||
NumberInput,
|
||||
Paper,
|
||||
Select,
|
||||
Stack,
|
||||
Text,
|
||||
TextInput,
|
||||
} from "@mantine/core";
|
||||
import { IconCamera } from "@tabler/icons-react";
|
||||
import { IconCamera, IconPdf, IconUpload } from "@tabler/icons-react";
|
||||
import _ from "lodash";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { useState } from "react";
|
||||
@@ -43,6 +44,9 @@ export default function InvestasiCreate({
|
||||
const router = useRouter();
|
||||
const [fl, setFl] = useState<File | null>(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 [activeTab, setActiveTab] = useAtom(gs_StatusPortoInvestasi);
|
||||
const [totalLembar, setTotalLembar] = useState(0);
|
||||
@@ -57,7 +61,6 @@ export default function InvestasiCreate({
|
||||
pembagianDevidenId: "",
|
||||
});
|
||||
|
||||
|
||||
async function onSubmit() {
|
||||
const body = {
|
||||
authorId: id,
|
||||
@@ -72,18 +75,22 @@ export default function InvestasiCreate({
|
||||
};
|
||||
// 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");
|
||||
if (!fl) return toast("File Kosong");
|
||||
const gmbr = new FormData();
|
||||
gmbr.append("file", fl);
|
||||
|
||||
const fd = new FormData();
|
||||
fd.append("file", fl);
|
||||
await funCreateInvestasi(fd, body as any).then((res) => {
|
||||
const flPdf = new FormData();
|
||||
flPdf.append("file", pdf);
|
||||
|
||||
await funCreateInvestasi(gmbr, flPdf, body as any).then((res) => {
|
||||
if (res.status === 201) {
|
||||
// toast(res.message);
|
||||
setChangeColor(1);
|
||||
setActiveTab("Draft");
|
||||
router.push(RouterInvestasi.dialog_create)
|
||||
setActiveTab("Review");
|
||||
router.push(RouterInvestasi.dialog_create);
|
||||
} else {
|
||||
toast(res.message);
|
||||
}
|
||||
@@ -98,40 +105,81 @@ export default function InvestasiCreate({
|
||||
return (
|
||||
<>
|
||||
<Box>
|
||||
<AspectRatio ratio={16 / 9}>
|
||||
{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>
|
||||
|
||||
{/* Inputan Create */}
|
||||
<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
|
||||
withAsterisk
|
||||
label="Judul Investasi"
|
||||
@@ -175,7 +223,7 @@ export default function InvestasiCreate({
|
||||
<Text>{totalLembar}</Text>
|
||||
<Divider />
|
||||
</Stack>
|
||||
<Text c={"red"} fz={10}>
|
||||
<Text c={"blue"} fz={10}>
|
||||
*Total lembar dihitung dari, Target Dana : Harga Perlembar
|
||||
</Text>
|
||||
</Stack>
|
||||
|
||||
@@ -146,11 +146,15 @@ export default function DetailInvestasi({
|
||||
<Stack>
|
||||
<Box>
|
||||
<Text>Dana Dibutuhkan</Text>
|
||||
<Text>Rp. {investasi.targetDana}</Text>
|
||||
<Text>Rp. {new Intl.NumberFormat("id-ID", {
|
||||
maximumSignificantDigits: 10,
|
||||
}).format(+investasi.targetDana)}</Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<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>
|
||||
<Text>Jadwal Pembagian</Text>
|
||||
@@ -170,11 +174,15 @@ export default function DetailInvestasi({
|
||||
</Box>
|
||||
<Box>
|
||||
<Text>Total Lembar</Text>
|
||||
<Text>{investasi.totalLembar} lembar</Text>
|
||||
<Text>{new Intl.NumberFormat("id-ID", {
|
||||
maximumSignificantDigits: 10,
|
||||
}).format(+investasi.totalLembar)} lembar</Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<Text>Sisa Lembar</Text>
|
||||
<Text>{investasi.sisaLembar} lembar</Text>
|
||||
<Text>{new Intl.NumberFormat("id-ID", {
|
||||
maximumSignificantDigits: 10,
|
||||
}).format(+investasi.sisaLembar)} lembar</Text>
|
||||
</Box>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
|
||||
@@ -91,7 +91,7 @@ export default function DetailDraftInvestasi({
|
||||
{/* Title dan Persentase */}
|
||||
<Center>
|
||||
<Title order={4} mb={"xs"}>
|
||||
{investasi.title}
|
||||
{_.capitalize(investasi.title)}
|
||||
</Title>
|
||||
</Center>
|
||||
|
||||
@@ -101,11 +101,15 @@ export default function DetailDraftInvestasi({
|
||||
<Stack>
|
||||
<Box>
|
||||
<Text>Dana Dibutuhkan</Text>
|
||||
<Text>Rp. {investasi.targetDana}</Text>
|
||||
<Text>Rp. {new Intl.NumberFormat("id-ID", {
|
||||
maximumSignificantDigits: 10,
|
||||
}).format(+investasi.targetDana)}</Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<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>
|
||||
<Text>Jadwal Pembagian</Text>
|
||||
@@ -121,11 +125,13 @@ export default function DetailDraftInvestasi({
|
||||
<Stack>
|
||||
<Box>
|
||||
<Text>ROI</Text>
|
||||
<Text>{investasi.roi}%</Text>
|
||||
<Text>{investasi.roi} %</Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<Text>Total Lembar</Text>
|
||||
<Text>{investasi.totalLembar} lembar</Text>
|
||||
<Text>{new Intl.NumberFormat("id-ID", {
|
||||
maximumSignificantDigits: 10,
|
||||
}).format(+investasi.totalLembar)} lembar</Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<Text>Pembagian Deviden</Text>
|
||||
|
||||
@@ -109,16 +109,30 @@ export default function DetailPublishInvestasi({
|
||||
<Stack>
|
||||
<Box>
|
||||
<Text>Dana Dibutuhkan</Text>
|
||||
<Text>Rp. {investasi.targetDana}</Text>
|
||||
<Text>
|
||||
Rp.{" "}
|
||||
{new Intl.NumberFormat("id-ID", {
|
||||
maximumSignificantDigits: 10,
|
||||
}).format(+investasi.targetDana)}
|
||||
</Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<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>
|
||||
<Text>Jadwal Pembagian</Text>
|
||||
<Text>{investasi.MasterPembagianDeviden.name} bulan </Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<Text>Pembagian Deviden</Text>
|
||||
<Text>{investasi.MasterPeriodeDeviden.name}</Text>
|
||||
</Box>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={6}>
|
||||
@@ -129,11 +143,21 @@ export default function DetailPublishInvestasi({
|
||||
</Box>
|
||||
<Box>
|
||||
<Text>Total Lembar</Text>
|
||||
<Text>{investasi.totalLembar} lembar</Text>
|
||||
<Text>
|
||||
{new Intl.NumberFormat("id-ID", {
|
||||
maximumSignificantDigits: 10,
|
||||
}).format(+investasi.totalLembar)}{" "}
|
||||
lembar
|
||||
</Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<Text>Pembagian Deviden</Text>
|
||||
<Text>{investasi.MasterPeriodeDeviden.name}</Text>
|
||||
<Text>Sisa Lembar</Text>
|
||||
<Text>
|
||||
{new Intl.NumberFormat("id-ID", {
|
||||
maximumSignificantDigits: 10,
|
||||
}).format(+investasi.sisaLembar)}{" "}
|
||||
lembar
|
||||
</Text>
|
||||
</Box>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
|
||||
@@ -18,8 +18,8 @@ export default function LayoutDetailRejecttInvestasi({
|
||||
header={
|
||||
<HeaderTamplate
|
||||
title="Detail Reject"
|
||||
icon={<IconEdit />}
|
||||
route2={`/dev/investasi/edit/${idInves}`}
|
||||
// icon={<IconEdit />}
|
||||
// route2={`/dev/investasi/edit/${idInves}`}
|
||||
/>
|
||||
}
|
||||
>
|
||||
|
||||
@@ -22,9 +22,11 @@ import {
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import {
|
||||
IconArrowBackUpDouble,
|
||||
IconBookDownload,
|
||||
IconFileDescription,
|
||||
IconSpeakerphone,
|
||||
IconTrash,
|
||||
} from "@tabler/icons-react";
|
||||
import { useAtom } from "jotai";
|
||||
import { useRouter } from "next/navigation";
|
||||
@@ -59,20 +61,20 @@ export default function DetailRejectInvestasi({
|
||||
icon: <IconFileDescription size={70} />,
|
||||
route: RouterInvestasi.edit_dokumen,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "Berita",
|
||||
icon: <IconSpeakerphone size={70} />,
|
||||
route: RouterInvestasi.edit_berita,
|
||||
},
|
||||
// {
|
||||
// id: 3,
|
||||
// name: "Berita",
|
||||
// icon: <IconSpeakerphone size={70} />,
|
||||
// route: RouterInvestasi.edit_berita,
|
||||
// },
|
||||
];
|
||||
|
||||
async function onAjukan() {
|
||||
await funGantiStatusInvestasi(investasi.id, "2").then((res) => {
|
||||
await funGantiStatusInvestasi(investasi.id, "1").then((res) => {
|
||||
if (res.status === 200) {
|
||||
toast("Project Diajukan Kembali");
|
||||
setActiveTab("Draft");
|
||||
router.push(RouterInvestasi.portofolio);
|
||||
setActiveTab("Review");
|
||||
} else {
|
||||
toast("Gagal Pengajuan");
|
||||
}
|
||||
@@ -110,7 +112,7 @@ export default function DetailRejectInvestasi({
|
||||
</Modal>
|
||||
|
||||
{/* Alasan */}
|
||||
<Box mb={"sm"}>
|
||||
<Box mb={"xl"}>
|
||||
<Title order={6}>Alasan :</Title>
|
||||
<Box>
|
||||
<Paper>
|
||||
@@ -124,6 +126,7 @@ export default function DetailRejectInvestasi({
|
||||
<Grid.Col span={6}>
|
||||
<Center>
|
||||
<Button
|
||||
leftIcon={<IconArrowBackUpDouble/>}
|
||||
mb={"xl"}
|
||||
radius={50}
|
||||
bg={"orange.7"}
|
||||
@@ -131,7 +134,7 @@ export default function DetailRejectInvestasi({
|
||||
compact
|
||||
onClick={() => onAjukan()}
|
||||
>
|
||||
Ajukan Kembali
|
||||
Masuk ke Draft
|
||||
</Button>
|
||||
</Center>
|
||||
</Grid.Col>
|
||||
@@ -141,6 +144,7 @@ export default function DetailRejectInvestasi({
|
||||
<Center>
|
||||
{" "}
|
||||
<Button
|
||||
leftIcon={<IconTrash size={12}/>}
|
||||
compact
|
||||
mb={"xl"}
|
||||
radius={50}
|
||||
@@ -176,11 +180,15 @@ export default function DetailRejectInvestasi({
|
||||
<Stack>
|
||||
<Box>
|
||||
<Text>Dana Dibutuhkan</Text>
|
||||
<Text>Rp. {investasi.targetDana}</Text>
|
||||
<Text>Rp. {new Intl.NumberFormat("id-ID", {
|
||||
maximumSignificantDigits: 10,
|
||||
}).format(+investasi.targetDana)}</Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<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>
|
||||
<Text>Jadwal Pembagian</Text>
|
||||
@@ -200,7 +208,9 @@ export default function DetailRejectInvestasi({
|
||||
</Box>
|
||||
<Box>
|
||||
<Text>Total Lembar</Text>
|
||||
<Text>{investasi.totalLembar} lembar</Text>
|
||||
<Text>{new Intl.NumberFormat("id-ID", {
|
||||
maximumSignificantDigits: 10,
|
||||
}).format(+investasi.totalLembar)} lembar</Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<Text>Pembagian Deviden</Text>
|
||||
@@ -211,14 +221,15 @@ export default function DetailRejectInvestasi({
|
||||
</Grid>
|
||||
|
||||
{/* List Box */}
|
||||
{/* <Grid mb={"md"}>
|
||||
<Grid mb={"md"}>
|
||||
{listBox.map((e) => (
|
||||
<Grid.Col
|
||||
span={"auto"}
|
||||
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"}>
|
||||
<Text fz={12}>{e.name}</Text>
|
||||
<ActionIcon variant="transparent" size={60}>
|
||||
@@ -226,9 +237,10 @@ export default function DetailRejectInvestasi({
|
||||
</ActionIcon>
|
||||
</Flex>
|
||||
</Paper>
|
||||
</Center>
|
||||
</Grid.Col>
|
||||
))}
|
||||
</Grid> */}
|
||||
</Grid>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -31,11 +31,16 @@ import toast from "react-simple-toasts";
|
||||
import { MODEL_Investasi } from "../../model/model_investasi";
|
||||
import funGantiStatusInvestasi from "../../fun/fun_ganti_status";
|
||||
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 [activeTab, setActiveTab] = useAtom(gs_StatusPortoInvestasi);
|
||||
const [investasi,setInvestasi] = useState<MODEL_Investasi>(dataInvestasi)
|
||||
const [investasi, setInvestasi] = useState<MODEL_Investasi>(dataInvestasi);
|
||||
|
||||
const listBox = [
|
||||
{
|
||||
@@ -50,12 +55,12 @@ export default function DetailReviewInvestasi({dataInvestasi}:{dataInvestasi: MO
|
||||
icon: <IconFileDescription size={70} />,
|
||||
route: RouterInvestasi.detail_dokumen,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: "Berita",
|
||||
icon: <IconSpeakerphone size={70} />,
|
||||
route: RouterInvestasi.berita,
|
||||
},
|
||||
// {
|
||||
// id: 3,
|
||||
// name: "Berita",
|
||||
// icon: <IconSpeakerphone size={70} />,
|
||||
// route: RouterInvestasi.berita,
|
||||
// },
|
||||
];
|
||||
|
||||
async function onsubmit() {
|
||||
@@ -76,7 +81,7 @@ export default function DetailReviewInvestasi({dataInvestasi}:{dataInvestasi: MO
|
||||
<>
|
||||
<Paper withBorder mb={"md"}>
|
||||
<AspectRatio ratio={16 / 9}>
|
||||
<Image
|
||||
<Image
|
||||
alt=""
|
||||
src={RouterInvestasi.api_gambar + `${investasi.imagesId}`}
|
||||
/>
|
||||
@@ -84,11 +89,11 @@ export default function DetailReviewInvestasi({dataInvestasi}:{dataInvestasi: MO
|
||||
</Paper>
|
||||
|
||||
{/* Title dan Persentase */}
|
||||
<Box mb={"md"}>
|
||||
<Center mb={"xs"}>
|
||||
<Title order={4} mb={"xs"}>
|
||||
{investasi.title}
|
||||
{_.capitalize(investasi.title)}
|
||||
</Title>
|
||||
</Box>
|
||||
</Center>
|
||||
|
||||
{/* Rincian Data */}
|
||||
<Grid p={"md"} mb={"md"}>
|
||||
@@ -96,11 +101,15 @@ export default function DetailReviewInvestasi({dataInvestasi}:{dataInvestasi: MO
|
||||
<Stack>
|
||||
<Box>
|
||||
<Text>Dana Dibutuhkan</Text>
|
||||
<Text>Rp. {investasi.targetDana}</Text>
|
||||
<Text>Rp. {new Intl.NumberFormat("id-ID", {
|
||||
maximumSignificantDigits: 20,
|
||||
}).format(+investasi.targetDana)}</Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<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>
|
||||
<Text>Jadwal Pembagian</Text>
|
||||
@@ -120,7 +129,9 @@ export default function DetailReviewInvestasi({dataInvestasi}:{dataInvestasi: MO
|
||||
</Box>
|
||||
<Box>
|
||||
<Text>Total Lembar</Text>
|
||||
<Text>{investasi.totalLembar} lembar</Text>
|
||||
<Text>{new Intl.NumberFormat("id-ID", {
|
||||
maximumSignificantDigits: 10,
|
||||
}).format(+investasi.totalLembar)} lembar</Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<Text>Pembagian Deviden</Text>
|
||||
@@ -138,14 +149,16 @@ export default function DetailReviewInvestasi({dataInvestasi}:{dataInvestasi: MO
|
||||
key={e.id}
|
||||
onClick={() => router.push(e.route + `${investasi.id}`)}
|
||||
>
|
||||
<Paper h={100} w={100} bg={"gray.4"} withBorder py={"xs"}>
|
||||
<Flex direction={"column"} align={"center"} justify={"center"}>
|
||||
<Text fz={12}>{e.name}</Text>
|
||||
<ActionIcon variant="transparent" size={60}>
|
||||
{e.icon}
|
||||
</ActionIcon>
|
||||
</Flex>
|
||||
</Paper>
|
||||
<Center>
|
||||
<Paper h={100} w={100} bg={"gray.4"} withBorder py={"xs"}>
|
||||
<Flex direction={"column"} align={"center"} justify={"center"}>
|
||||
<Text fz={12}>{e.name}</Text>
|
||||
<ActionIcon variant="transparent" size={60}>
|
||||
{e.icon}
|
||||
</ActionIcon>
|
||||
</Flex>
|
||||
</Paper>
|
||||
</Center>
|
||||
</Grid.Col>
|
||||
))}
|
||||
</Grid>
|
||||
|
||||
@@ -23,11 +23,11 @@ export default function EditInvestasi({id}:{id:string}) {
|
||||
name: "Dokumen",
|
||||
route: RouterInvestasi.edit_dokumen,
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: "Berita",
|
||||
route: RouterInvestasi.list_edit_berita,
|
||||
},
|
||||
// {
|
||||
// id: 4,
|
||||
// name: "Berita",
|
||||
// route: RouterInvestasi.list_edit_berita,
|
||||
// },
|
||||
];
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
Stack,
|
||||
Modal,
|
||||
} from "@mantine/core";
|
||||
import { IconCamera, IconChevronRight } from "@tabler/icons-react";
|
||||
import { IconCamera, IconChevronRight, IconUpload } from "@tabler/icons-react";
|
||||
import Link from "next/link";
|
||||
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 { useDisclosure, useWindowScroll } from "@mantine/hooks";
|
||||
|
||||
|
||||
export default function EditIntroInvestasi({
|
||||
dataInvestasi,
|
||||
listPencarian,
|
||||
@@ -94,18 +93,20 @@ export default function EditIntroInvestasi({
|
||||
</Group>
|
||||
</Modal>
|
||||
|
||||
<Box>
|
||||
<Stack spacing={"xs"} px={"md"}>
|
||||
<AspectRatio ratio={16 / 9}>
|
||||
{img ? (
|
||||
<Image alt="" src={img} />
|
||||
) : (
|
||||
<Image
|
||||
alt=""
|
||||
src={RouterInvestasi.api_gambar + `${edit_inves.imagesId}`}
|
||||
/>
|
||||
)}
|
||||
<Paper withBorder radius={"md"}>
|
||||
{img ? (
|
||||
<Image alt="" src={img} />
|
||||
) : (
|
||||
<Image
|
||||
alt=""
|
||||
src={RouterInvestasi.api_gambar + `${edit_inves.imagesId}`}
|
||||
/>
|
||||
)}
|
||||
</Paper>
|
||||
</AspectRatio>
|
||||
<Group position="center" mt={"md"}>
|
||||
<Group position="center" mb={"md"}>
|
||||
<FileButton
|
||||
onChange={async (files: any) => {
|
||||
const buffer = URL.createObjectURL(
|
||||
@@ -117,130 +118,134 @@ export default function EditIntroInvestasi({
|
||||
accept="image/png,image/jpeg"
|
||||
>
|
||||
{(props) => (
|
||||
<Button {...props} radius={50}>
|
||||
<IconCamera />
|
||||
<Button
|
||||
{...props}
|
||||
radius={50}
|
||||
leftIcon={<IconUpload size={12} />}
|
||||
compact
|
||||
bg={Warna.hijau_muda}
|
||||
color="green"
|
||||
>
|
||||
Upload Gambar
|
||||
</Button>
|
||||
)}
|
||||
</FileButton>
|
||||
</Group>
|
||||
|
||||
<Center>
|
||||
<Box mt={"md"} w={350}>
|
||||
<TextInput
|
||||
label="Judul Proyek"
|
||||
placeholder={"Masukan Judul"}
|
||||
value={edit_inves.title}
|
||||
onChange={(val) => {
|
||||
setEdit_inves({
|
||||
...edit_inves,
|
||||
title: val.target.value,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
<TextInput
|
||||
label="Judul Proyek"
|
||||
placeholder={"Masukan Judul"}
|
||||
value={edit_inves.title}
|
||||
onChange={(val) => {
|
||||
setEdit_inves({
|
||||
...edit_inves,
|
||||
title: val.target.value,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
|
||||
<NumberInput
|
||||
label="Dana Dibutuhan"
|
||||
type="number"
|
||||
value={+edit_inves.targetDana}
|
||||
onChange={(val) => {
|
||||
setEdit_inves({
|
||||
...edit_inves,
|
||||
targetDana: val as any,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
<NumberInput
|
||||
label="Dana Dibutuhan"
|
||||
type="number"
|
||||
value={+edit_inves.targetDana}
|
||||
onChange={(val) => {
|
||||
setEdit_inves({
|
||||
...edit_inves,
|
||||
targetDana: val as any,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
|
||||
<NumberInput
|
||||
label="Harga Per Lember"
|
||||
type="number"
|
||||
value={+edit_inves.hargaLembar}
|
||||
onChange={(val) => {
|
||||
setEdit_inves({
|
||||
...edit_inves,
|
||||
hargaLembar: val as any,
|
||||
});
|
||||
onTotalLembar(edit_inves.targetDana, val);
|
||||
}}
|
||||
/>
|
||||
<NumberInput
|
||||
label="Harga Per Lember"
|
||||
type="number"
|
||||
value={+edit_inves.hargaLembar}
|
||||
onChange={(val) => {
|
||||
setEdit_inves({
|
||||
...edit_inves,
|
||||
hargaLembar: val as any,
|
||||
});
|
||||
onTotalLembar(edit_inves.targetDana, val);
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* Total Lembar */}
|
||||
<Stack spacing={3}>
|
||||
<Text fz={"sm"} fw={500}>
|
||||
Total Lembar
|
||||
</Text>
|
||||
<Stack spacing={0}>
|
||||
<Text>{totalLembar}</Text>
|
||||
<Divider />
|
||||
</Stack>
|
||||
<Text c={"red"} fz={10}>
|
||||
*Total lembar dihitung dari, Target Dana : Harga Perlembar
|
||||
</Text>
|
||||
</Stack>
|
||||
{/* Total Lembar */}
|
||||
<Stack spacing={3}>
|
||||
<Text fz={"sm"} fw={500}>
|
||||
Total Lembar
|
||||
</Text>
|
||||
<Stack spacing={0}>
|
||||
<Text>{totalLembar}</Text>
|
||||
<Divider />
|
||||
</Stack>
|
||||
<Text c={"blue"} fz={10}>
|
||||
*Total lembar dihitung dari, Target Dana : Harga Perlembar
|
||||
</Text>
|
||||
</Stack>
|
||||
|
||||
<NumberInput
|
||||
label="Rasio Keuntungan / ROI"
|
||||
type="number"
|
||||
value={+edit_inves.roi}
|
||||
onChange={(val) => {
|
||||
setEdit_inves({
|
||||
...edit_inves,
|
||||
roi: val as any,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
<NumberInput
|
||||
label="Rasio Keuntungan / ROI"
|
||||
type="number"
|
||||
value={+edit_inves.roi}
|
||||
onChange={(val) => {
|
||||
setEdit_inves({
|
||||
...edit_inves,
|
||||
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"}>
|
||||
<Button
|
||||
w={200}
|
||||
@@ -255,7 +260,7 @@ export default function EditIntroInvestasi({
|
||||
Update
|
||||
</Button>
|
||||
</Center>
|
||||
</Box>
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,21 +9,17 @@ import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import { MODEL_Investasi } from "../model/model_investasi";
|
||||
|
||||
export async function funCreateInvestasi(
|
||||
formData: FormData,
|
||||
gamabar: FormData,
|
||||
filePdf: FormData,
|
||||
data: MODEL_Investasi | any
|
||||
) {
|
||||
|
||||
// return {
|
||||
// status: 201,
|
||||
// message: "Berhasil Disimpan",
|
||||
// };
|
||||
|
||||
const file: any = formData.get("file");
|
||||
// Function upload gambar
|
||||
const file: any = gamabar.get("file");
|
||||
const fName = file.name;
|
||||
const fExt = _.lowerCase(file.name.split(".").pop());
|
||||
const fRandomName = v4(fName) + "." + fExt;
|
||||
|
||||
const upload = await prisma.images.create({
|
||||
const uploadImage = await prisma.images.create({
|
||||
data: {
|
||||
url: fRandomName,
|
||||
},
|
||||
@@ -33,16 +29,14 @@ export async function funCreateInvestasi(
|
||||
},
|
||||
});
|
||||
|
||||
if (!upload)
|
||||
if (!uploadImage)
|
||||
return {
|
||||
status: 400,
|
||||
message: "File Kosong",
|
||||
};
|
||||
|
||||
const upFolder = Buffer.from(await file.arrayBuffer());
|
||||
fs.writeFileSync(`./public/investasi/${upload.url}`, upFolder);
|
||||
|
||||
// console.log(data)
|
||||
fs.writeFileSync(`./public/investasi/${uploadImage.url}`, upFolder);
|
||||
|
||||
const createInvest = await prisma.investasi.create({
|
||||
data: {
|
||||
@@ -51,23 +45,46 @@ export async function funCreateInvestasi(
|
||||
targetDana: data.targetDana.toString(),
|
||||
hargaLembar: data.hargaLembar.toString(),
|
||||
totalLembar: data.totalLembar.toString(),
|
||||
sisaLembar: data.totalLembar.toString() ,
|
||||
sisaLembar: data.totalLembar.toString(),
|
||||
roi: data.roi.toString(),
|
||||
masterPembagianDevidenId: data.masterPeriodeDevidenId,
|
||||
masterPeriodeDevidenId: data.masterPembagianDevidenId,
|
||||
masterPencarianInvestorId: data.masterPencarianInvestorId,
|
||||
imagesId: upload.id,
|
||||
masterStatusInvestasiId: "1",
|
||||
imagesId: uploadImage.id,
|
||||
masterStatusInvestasiId: "2",
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
if (!createInvest)
|
||||
return {
|
||||
status: 400,
|
||||
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);
|
||||
|
||||
return {
|
||||
|
||||
@@ -41,9 +41,9 @@ export default async function funEditInvestasi(
|
||||
},
|
||||
data: {
|
||||
title: data.title,
|
||||
targetDana: data.targetDana,
|
||||
hargaLembar: data.hargaLembar,
|
||||
totalLembar: data.totalLembar,
|
||||
targetDana: "" + data.targetDana,
|
||||
hargaLembar: "" + data.hargaLembar,
|
||||
totalLembar: "" + data.totalLembar,
|
||||
roi: data.roi,
|
||||
masterPencarianInvestorId: data.MasterPencarianInvestor.id,
|
||||
masterPembagianDevidenId: data.MasterPembagianDeviden.id,
|
||||
|
||||
@@ -20,7 +20,7 @@ export default async function getPortoByStatusId(id: string, statusId: number) {
|
||||
title: true,
|
||||
imagesId: true,
|
||||
// hargaLembar: true,
|
||||
// targetDana: true,
|
||||
targetDana: true,
|
||||
// totalLembar: true,
|
||||
// roi: true,
|
||||
// active: true,
|
||||
@@ -53,6 +53,7 @@ export default async function getPortoByStatusId(id: string, statusId: number) {
|
||||
id: true,
|
||||
title: true,
|
||||
imagesId: true,
|
||||
targetDana: true,
|
||||
},
|
||||
});
|
||||
return data;
|
||||
@@ -75,6 +76,7 @@ export default async function getPortoByStatusId(id: string, statusId: number) {
|
||||
title: true,
|
||||
imagesId: true,
|
||||
updatedAt: true,
|
||||
targetDana: true,
|
||||
MasterPencarianInvestor: true,
|
||||
},
|
||||
});
|
||||
@@ -97,6 +99,7 @@ export default async function getPortoByStatusId(id: string, statusId: number) {
|
||||
id: true,
|
||||
title: true,
|
||||
imagesId: true,
|
||||
targetDana: true
|
||||
},
|
||||
});
|
||||
return data;
|
||||
|
||||
@@ -69,8 +69,8 @@ export default function LayoutMainInvestasi({
|
||||
<HeaderTamplate
|
||||
route="/dev/crowd/main"
|
||||
title="Investasi"
|
||||
icon={<IconPencilPlus />}
|
||||
route2={"/dev/investasi/create"}
|
||||
// icon={<IconPencilPlus />}
|
||||
// route2={"/dev/investasi/create"}
|
||||
/>
|
||||
}
|
||||
footer={
|
||||
|
||||
@@ -45,7 +45,6 @@ export default function MainInvestasi({
|
||||
const router = useRouter();
|
||||
const [investasi, setInvestasi] = useState(listData);
|
||||
|
||||
|
||||
if (_.isEmpty(investasi))
|
||||
return (
|
||||
<>
|
||||
@@ -62,9 +61,11 @@ export default function MainInvestasi({
|
||||
|
||||
{investasi.map((e) => (
|
||||
<Card
|
||||
// sx={{ borderStyle: "solid", borderColor: "black", borderWidth: "0.5px" }}
|
||||
|
||||
key={e.id}
|
||||
withBorder
|
||||
mb={"lg"}
|
||||
bg={"teal"}
|
||||
onClick={() => router.push(`/dev/investasi/detail/${e.id}`)}
|
||||
>
|
||||
<CardSection p={"xs"}>
|
||||
@@ -98,11 +99,18 @@ export default function MainInvestasi({
|
||||
<Stack>
|
||||
<Box>
|
||||
<Text>Dana Dibutuhkan</Text>
|
||||
<Text>Rp. {e.targetDana}</Text>
|
||||
<Text>Rp. {new Intl.NumberFormat("id-ID", {
|
||||
maximumSignificantDigits: 10,
|
||||
}).format(+e.targetDana)}</Text>
|
||||
</Box>
|
||||
<Box>
|
||||
<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>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
@@ -114,7 +122,7 @@ export default function MainInvestasi({
|
||||
</Box>
|
||||
<Box>
|
||||
<Text>Total Lembar</Text>
|
||||
<Text>{e.totalLembar}</Text>
|
||||
<Text>{new Intl.NumberFormat("id-ID").format(+e.totalLembar)}</Text>
|
||||
</Box>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
|
||||
@@ -11,6 +11,10 @@ import {
|
||||
Image,
|
||||
Text,
|
||||
Center,
|
||||
Paper,
|
||||
Grid,
|
||||
Flex,
|
||||
Stack,
|
||||
} from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { MODEL_Investasi } from "../model/model_investasi";
|
||||
@@ -18,53 +22,55 @@ import _ from "lodash";
|
||||
|
||||
export default function Draft({ data }: { data: MODEL_Investasi[] }) {
|
||||
const router = useRouter();
|
||||
// console.log(data)
|
||||
|
||||
if (_.isEmpty(data))
|
||||
return (
|
||||
<>
|
||||
<Center h={"50vh"}>Tidak ada Draft</Center>
|
||||
</>
|
||||
);
|
||||
|
||||
|
||||
return (
|
||||
<>
|
||||
<Center h={"50vh"}>Tidak ada Draft</Center>
|
||||
</>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* <pre> {JSON.stringify(data,null, 2)}</pre> */}
|
||||
{data.map((e) =>
|
||||
<Card
|
||||
key={e.id}
|
||||
withBorder
|
||||
mb={40}
|
||||
bg={"gray.5"}
|
||||
onClick={() =>
|
||||
router.push(RouterInvestasi.detail_draft + `${e.id}`)
|
||||
}
|
||||
>
|
||||
<CardSection p={"xs"}>
|
||||
<AspectRatio ratio={16 / 9}>
|
||||
<Image
|
||||
alt=""
|
||||
src={RouterInvestasi.api_gambar + `${e.imagesId}`}
|
||||
/>
|
||||
</AspectRatio>
|
||||
</CardSection>
|
||||
{data.map((e) => (
|
||||
<Paper
|
||||
// sx={{ borderStyle: "solid", borderColor: "yellow", borderWidth: "0.5px" }}
|
||||
p={"xs"}
|
||||
key={e.id}
|
||||
mb={"md"}
|
||||
bg={"yellow.1"}
|
||||
withBorder
|
||||
onClick={() => router.push(RouterInvestasi.detail_draft + `${e.id}`)}
|
||||
>
|
||||
<Grid>
|
||||
<Grid.Col span={8}>
|
||||
<Text fw={"bold"}> {_.capitalize(e.title)}</Text>
|
||||
<Stack spacing={0}>
|
||||
<Text fz={10}>Target Dana:</Text>
|
||||
<Text>
|
||||
Rp.{" "}
|
||||
{new Intl.NumberFormat("id-ID", {
|
||||
maximumSignificantDigits: 10,
|
||||
}).format(+e.targetDana)}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
|
||||
<CardSection p={"lg"}>
|
||||
<Box>
|
||||
<Title order={4}>{e.title}</Title>
|
||||
</Box>
|
||||
</CardSection>
|
||||
<Divider />
|
||||
<CardSection p={"md"}>
|
||||
<Group position="center">
|
||||
<Badge color="yellow" variant="dot">
|
||||
Draft
|
||||
</Badge>
|
||||
</Group>
|
||||
</CardSection>
|
||||
</Card>
|
||||
)}
|
||||
<Grid.Col span={4}>
|
||||
<AspectRatio ratio={16 / 9}>
|
||||
<Paper radius={"md"}>
|
||||
<Image
|
||||
alt=""
|
||||
src={RouterInvestasi.api_gambar + `${e.imagesId}`}
|
||||
/>
|
||||
</Paper>
|
||||
</AspectRatio>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Paper>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,6 +12,9 @@ import {
|
||||
Image,
|
||||
Text,
|
||||
Center,
|
||||
Grid,
|
||||
Stack,
|
||||
Paper,
|
||||
} from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import {
|
||||
@@ -36,38 +39,43 @@ export default function Publish({ data }: { data: MODEL_Investasi[] }) {
|
||||
return (
|
||||
<>
|
||||
{data.map((e) => (
|
||||
<Card
|
||||
<Paper
|
||||
key={e.id}
|
||||
withBorder
|
||||
mb={40}
|
||||
bg={"gray.5"}
|
||||
mb={"md"}
|
||||
p={"xs"}
|
||||
bg={"green.1"}
|
||||
onClick={() =>
|
||||
router.push(RouterInvestasi.detail_publish + `${e.id}`)
|
||||
}
|
||||
>
|
||||
<CardSection p={"xs"}>
|
||||
<AspectRatio ratio={16 / 9}>
|
||||
<Image
|
||||
alt=""
|
||||
src={RouterInvestasi.api_gambar + `${e.imagesId}`}
|
||||
/>
|
||||
</AspectRatio>
|
||||
</CardSection>
|
||||
<Grid>
|
||||
<Grid.Col span={8}>
|
||||
<Text fw={"bold"}> {_.capitalize(e.title)}</Text>
|
||||
<Stack spacing={0}>
|
||||
<Text fz={10}>Target Dana:</Text>
|
||||
<Text>
|
||||
Rp.{" "}
|
||||
{new Intl.NumberFormat("id-ID", {
|
||||
maximumSignificantDigits: 10,
|
||||
}).format(+e.targetDana)}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
|
||||
<CardSection p={"lg"}>
|
||||
<Box mb={"md"}>
|
||||
<Title order={4}>{e.title}</Title>
|
||||
{/* <Slider
|
||||
size={10}
|
||||
disabled
|
||||
labelAlwaysOn
|
||||
value={60}
|
||||
marks={[{ value: 60, label: 60 + `%` }]}
|
||||
/> */}
|
||||
</Box>
|
||||
</CardSection>
|
||||
<Divider />
|
||||
<CardSection p={"md"}>
|
||||
<Grid.Col span={4}>
|
||||
<AspectRatio ratio={16 / 9}>
|
||||
<Paper radius={"md"}>
|
||||
<Image
|
||||
alt=""
|
||||
src={RouterInvestasi.api_gambar + `${e.imagesId}`}
|
||||
/>
|
||||
</Paper>
|
||||
</AspectRatio>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
<Divider my={"xs"}/>
|
||||
<Group position="center">
|
||||
{Number(e.MasterPencarianInvestor.name) -
|
||||
moment(new Date()).diff(new Date(e.updatedAt), "days") <=
|
||||
0 ? (
|
||||
@@ -76,10 +84,10 @@ export default function Publish({ data }: { data: MODEL_Investasi[] }) {
|
||||
<Text c={"green"}>Selesai</Text>
|
||||
</Group>
|
||||
) : (
|
||||
<Group position="apart">
|
||||
<Badge color="green" variant="dot">
|
||||
<Group position="center">
|
||||
{/* <Badge color="green" variant="dot">
|
||||
Publish
|
||||
</Badge>
|
||||
</Badge> */}
|
||||
<Text>
|
||||
Sisa Waktu :{" "}
|
||||
{Number(e.MasterPencarianInvestor.name) -
|
||||
@@ -88,8 +96,8 @@ export default function Publish({ data }: { data: MODEL_Investasi[] }) {
|
||||
</Text>
|
||||
</Group>
|
||||
)}
|
||||
</CardSection>
|
||||
</Card>
|
||||
</Group>
|
||||
</Paper>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -11,6 +11,9 @@ import {
|
||||
Image,
|
||||
Text,
|
||||
Center,
|
||||
Grid,
|
||||
Stack,
|
||||
Paper,
|
||||
} from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import {
|
||||
@@ -35,36 +38,39 @@ export default function Reject({ data }: { data: MODEL_Investasi[] }) {
|
||||
<>
|
||||
|
||||
{investasi.map((e) => (
|
||||
<Card
|
||||
<Paper
|
||||
key={e.id}
|
||||
withBorder
|
||||
mb={40}
|
||||
bg={"gray.5"}
|
||||
mb={"md"}
|
||||
p={"xs"}
|
||||
bg={"red.1"}
|
||||
onClick={() => router.push(RouterInvestasi.detail_reject + `${e.id}`)}
|
||||
>
|
||||
<CardSection p={"xs"}>
|
||||
<AspectRatio ratio={16 / 9}>
|
||||
<Image
|
||||
alt=""
|
||||
src={RouterInvestasi.api_gambar + `${e.imagesId}`}
|
||||
/>
|
||||
</AspectRatio>
|
||||
</CardSection>
|
||||
<Grid>
|
||||
<Grid.Col span={8}>
|
||||
<Text fw={"bold"}> {_.capitalize(e.title)}</Text>
|
||||
<Stack spacing={0}>
|
||||
<Text fz={10}>Target Dana:</Text>
|
||||
<Text>
|
||||
Rp. {new Intl.NumberFormat("id-ID", {
|
||||
maximumSignificantDigits: 10,
|
||||
}).format(+e.targetDana)}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
|
||||
<CardSection p={"lg"}>
|
||||
<Box>
|
||||
<Title order={4}>{e.title}</Title>
|
||||
</Box>
|
||||
</CardSection>
|
||||
<Divider />
|
||||
<CardSection p={"md"}>
|
||||
<Group position="center">
|
||||
<Badge color="red" variant="dot">
|
||||
Reject
|
||||
</Badge>
|
||||
</Group>
|
||||
</CardSection>
|
||||
</Card>
|
||||
<Grid.Col span={4}>
|
||||
<AspectRatio ratio={16 / 9}>
|
||||
<Paper radius={"md"}>
|
||||
<Image
|
||||
alt=""
|
||||
src={RouterInvestasi.api_gambar + `${e.imagesId}`}
|
||||
/>
|
||||
</Paper>
|
||||
</AspectRatio>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Paper>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -11,6 +11,9 @@ import {
|
||||
Image,
|
||||
Center,
|
||||
Text,
|
||||
Paper,
|
||||
Grid,
|
||||
Stack,
|
||||
} from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import {
|
||||
@@ -31,36 +34,41 @@ export default function Review({ data }: { data: MODEL_Investasi[] }) {
|
||||
return (
|
||||
<>
|
||||
{data.map((e) => (
|
||||
<Card
|
||||
<Paper
|
||||
// sx={{ borderStyle: "solid", borderColor: "orange", borderWidth: "1px" }}
|
||||
key={e.id}
|
||||
mb={"md"}
|
||||
bg={"orange.1"}
|
||||
p={"xs"}
|
||||
withBorder
|
||||
mb={40}
|
||||
bg={"gray.5"}
|
||||
onClick={() => router.push(RouterInvestasi.detail_review + `${e.id}`)}
|
||||
>
|
||||
<CardSection p={"xs"}>
|
||||
<AspectRatio ratio={16 / 9}>
|
||||
<Image
|
||||
alt=""
|
||||
src={RouterInvestasi.api_gambar + `${e.imagesId}`}
|
||||
/>
|
||||
</AspectRatio>
|
||||
</CardSection>
|
||||
<Grid>
|
||||
<Grid.Col span={8}>
|
||||
<Text fw={"bold"}> {_.capitalize(e.title)}</Text>
|
||||
<Stack spacing={0}>
|
||||
<Text fz={10}>Target Dana:</Text>
|
||||
<Text>
|
||||
Rp.{" "}
|
||||
{new Intl.NumberFormat("id-ID", {
|
||||
maximumSignificantDigits: 10,
|
||||
}).format(+e.targetDana)}
|
||||
</Text>
|
||||
</Stack>
|
||||
</Grid.Col>
|
||||
|
||||
<CardSection p={"lg"}>
|
||||
<Box>
|
||||
<Title order={4}>{e.title}</Title>
|
||||
</Box>
|
||||
</CardSection>
|
||||
<Divider />
|
||||
<CardSection p={"md"}>
|
||||
<Group position="center">
|
||||
<Badge color="yellow" variant="dot">
|
||||
Review
|
||||
</Badge>
|
||||
</Group>
|
||||
</CardSection>
|
||||
</Card>
|
||||
<Grid.Col span={4}>
|
||||
<AspectRatio ratio={16 / 9}>
|
||||
<Paper radius={"md"}>
|
||||
<Image
|
||||
alt=""
|
||||
src={RouterInvestasi.api_gambar + `${e.imagesId}`}
|
||||
/>
|
||||
</Paper>
|
||||
</AspectRatio>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Paper>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -26,7 +26,11 @@ import {
|
||||
import dataDummy from "../dummy/data_dummy.json";
|
||||
import moment from "moment";
|
||||
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 "react-responsive-carousel/lib/styles/carousel.min.css"; // requires a loader
|
||||
@@ -73,38 +77,49 @@ export default function PortofolioInvestasi({
|
||||
return (
|
||||
<>
|
||||
{/* <pre>{JSON.stringify(dataInvestasi, null, 2)}</pre> */}
|
||||
<Tabs
|
||||
variant="pills"
|
||||
radius="xl"
|
||||
defaultValue="Draft"
|
||||
value={activeTab}
|
||||
onTabChange={setActiveTab}
|
||||
>
|
||||
<Tabs.List>
|
||||
{status_inves.map((e) => (
|
||||
<Tabs.Tab
|
||||
key={e.id}
|
||||
value={e.name}
|
||||
color={!activeTab ? "gray" : e.color}
|
||||
>
|
||||
{e.name}
|
||||
</Tabs.Tab>
|
||||
))}
|
||||
</Tabs.List>
|
||||
<Divider my={"xs"} />
|
||||
<Tabs.Panel key={"1"} value="Draft">
|
||||
<Draft data={dataDraft as any} />
|
||||
</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>
|
||||
<Button
|
||||
radius={"xl"}
|
||||
bg={Warna.biru}
|
||||
color="blue"
|
||||
leftIcon={<IconCirclePlus />}
|
||||
onClick={() => router.push(RouterInvestasi.create)}
|
||||
>
|
||||
Buat Proyek Invetasi
|
||||
</Button>
|
||||
<Tabs
|
||||
variant="pills"
|
||||
radius="xl"
|
||||
defaultValue="Draft"
|
||||
value={activeTab}
|
||||
onTabChange={setActiveTab}
|
||||
>
|
||||
<Tabs.List grow>
|
||||
{status_inves.map((e) => (
|
||||
<Tabs.Tab
|
||||
key={e.id}
|
||||
value={e.name}
|
||||
color={!activeTab ? "gray" : e.color}
|
||||
>
|
||||
{e.name}
|
||||
</Tabs.Tab>
|
||||
))}
|
||||
</Tabs.List>
|
||||
<Divider my={"xs"} />
|
||||
<Tabs.Panel key={"1"} value="Draft">
|
||||
<Draft data={dataDraft as any} />
|
||||
</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";
|
||||
|
||||
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 toast from "react-simple-toasts";
|
||||
import {
|
||||
@@ -13,6 +13,7 @@ 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";
|
||||
import _ from "lodash";
|
||||
|
||||
export default function TransaksiInvestasi({
|
||||
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 (
|
||||
|
||||