diff --git a/src/app/api/auth/login/route.ts b/src/app/api/auth/login/route.ts
index b9281dfe..ef91c0e6 100644
--- a/src/app/api/auth/login/route.ts
+++ b/src/app/api/auth/login/route.ts
@@ -9,7 +9,7 @@ import { NextResponse } from "next/server";
export async function POST(req: Request) {
if (req.method === "POST") {
const body = await req.json();
- console.log(body);
+ // console.log(body);
if (body.nomor === "1234567890") {
return NextResponse.json({
diff --git a/src/app/dev/admin/investasi/halaman_aksi/[id]/layout.tsx b/src/app/dev/admin/investasi/halaman_aksi/[id]/layout.tsx
index e144f3c9..c769c7ad 100644
--- a/src/app/dev/admin/investasi/halaman_aksi/[id]/layout.tsx
+++ b/src/app/dev/admin/investasi/halaman_aksi/[id]/layout.tsx
@@ -1,15 +1,10 @@
+
import { Admin_LayoutHalamanAksi } from "@/app_modules/admin/investasi";
import React from "react";
-export default async function Layout({
- children,
-}: {
- children: React.ReactNode;
-}) {
- return (
- <>
- {children}
- >
- );
+export default async function Layout({ children }: { children: React.ReactNode }) {
+ return <>
+ {children}
+ >;
}
diff --git a/src/app/dev/admin/investasi/halaman_aksi/[id]/page.tsx b/src/app/dev/admin/investasi/halaman_aksi/[id]/page.tsx
index 5070dfb4..3fe5b041 100644
--- a/src/app/dev/admin/investasi/halaman_aksi/[id]/page.tsx
+++ b/src/app/dev/admin/investasi/halaman_aksi/[id]/page.tsx
@@ -1,8 +1,9 @@
import { Admin_HalamanAksi } from "@/app_modules/admin/investasi";
-
export default async function Page() {
- return<>
-
+ return (
+ <>
+
>
-}
\ No newline at end of file
+ );
+}
diff --git a/src/app/dev/admin/main/investasi/page.tsx b/src/app/dev/admin/main/investasi/page.tsx
index 77f44e67..9bcfd40e 100644
--- a/src/app/dev/admin/main/investasi/page.tsx
+++ b/src/app/dev/admin/main/investasi/page.tsx
@@ -1,12 +1,24 @@
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";
export default async function Page() {
const listInvestasi = await Admin_funGetAllInvestasi();
- // console.log(listInvestasi)
+ const countDraft = await Admin_CountStatusInvestasi(1);
+ const countReview = await Admin_CountStatusInvestasi(2);
+ const countPublish = await Admin_CountStatusInvestasi(3);
+ const countReject = await Admin_CountStatusInvestasi(4);
+
return (
<>
-
+
>
);
}
diff --git a/src/app_modules/admin/investasi/fun/count_status.ts b/src/app_modules/admin/investasi/fun/count_status.ts
new file mode 100644
index 00000000..22fe1409
--- /dev/null
+++ b/src/app_modules/admin/investasi/fun/count_status.ts
@@ -0,0 +1,65 @@
+"use server";
+
+import prisma from "@/app/lib/prisma";
+import _ from "lodash";
+
+/**
+ *
+ * @param id
+ *
+ * @type number
+ * @returns count of status investasi
+ */
+export default async function Admin_CountStatusInvestasi(id: number) {
+ if (id === 1) {
+ const count = await prisma.investasi.count({
+ where: {
+ MasterStatusInvestasi: {
+ name: {
+ equals: "Draft",
+ },
+ },
+ },
+ });
+ return count;
+ }
+
+ if (id === 2) {
+ const count = await prisma.investasi.count({
+ where: {
+ MasterStatusInvestasi: {
+ name: {
+ equals: "Review",
+ },
+ },
+ },
+ });
+ return count;
+ }
+
+ if (id === 3) {
+ const count = await prisma.investasi.count({
+ where: {
+ MasterStatusInvestasi: {
+ name: {
+ equals: "Publish",
+ },
+ },
+ },
+ });
+ return count;
+ }
+
+ if (id === 4) {
+ const count = await prisma.investasi.count({
+ where: {
+ MasterStatusInvestasi: {
+ name: {
+ equals: "Reject",
+ },
+ },
+ },
+ });
+ return count;
+ }
+}
diff --git a/src/app_modules/admin/investasi/halaman_aksi/layout.tsx b/src/app_modules/admin/investasi/halaman_aksi/layout.tsx
index 5783573f..0e7b26a9 100644
--- a/src/app_modules/admin/investasi/halaman_aksi/layout.tsx
+++ b/src/app_modules/admin/investasi/halaman_aksi/layout.tsx
@@ -11,6 +11,7 @@ export default function Admin_LayoutHalamanAksi({
}) {
return (
<>
+ {/* {children} */}
}>
{children}
diff --git a/src/app_modules/admin/investasi/halaman_aksi/view.tsx b/src/app_modules/admin/investasi/halaman_aksi/view.tsx
index e1182013..88725613 100644
--- a/src/app_modules/admin/investasi/halaman_aksi/view.tsx
+++ b/src/app_modules/admin/investasi/halaman_aksi/view.tsx
@@ -3,11 +3,13 @@
import { RouterAdminInvestasi } from "@/app/lib/router_hipmi/router_admin";
import {
Box,
+ Button,
Center,
Flex,
Grid,
Group,
Paper,
+ SimpleGrid,
Stack,
Text,
Title,
@@ -34,7 +36,38 @@ export default function Admin_HalamanAksi() {
return (
<>
-
+
+ {listHalamanAksi.map((e) => (
+
+
+
+ {e.name}
+ {e.desc}
+
+
+
+
+
+
+ ))}
+
+ {/*
{listHalamanAksi.map((e) => (
router.push(e.route)}>
@@ -54,7 +87,7 @@ export default function Admin_HalamanAksi() {
))}
-
+ */}
>
);
}
diff --git a/src/app_modules/admin/investasi/main/view.tsx b/src/app_modules/admin/investasi/main/view.tsx
index c21d73f3..bbb807e2 100644
--- a/src/app_modules/admin/investasi/main/view.tsx
+++ b/src/app_modules/admin/investasi/main/view.tsx
@@ -7,49 +7,58 @@ import {
Badge,
Box,
Center,
+ Divider,
Grid,
Paper,
ScrollArea,
Stack,
Table,
Text,
+ Title,
} from "@mantine/core";
import { IconEdit } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
-const listBox = [
- {
- id: 1,
- name: "Investasi Baru",
- jumlah: 12,
- },
- {
- id: 2,
- name: "Investasi Aktif",
- jumlah: 3,
- },
- {
- id: 3,
- name: "Investasi Selesai",
- jumlah: 5,
- },
- {
- id: 4,
- name: "Total Proyek Investasi",
- jumlah: 2,
- },
-];
-
export default function Admin_Investasi({
listInvestasi,
+ countDraft,
+ countReview,
+ countPublish,
+ countReject,
}: {
listInvestasi: MODEL_Investasi[];
+ countDraft: number | any;
+ countReview: number | any;
+ countPublish: number | any;
+ countReject: number | any;
}) {
const [investasi, setInvestasi] = useState(listInvestasi);
-
const router = useRouter();
+ const listBox = [
+ {
+ id: 1,
+ name: "Draft",
+ jumlah: countDraft,
+ },
+ {
+ id: 2,
+ name: "Review",
+ jumlah: countReview,
+ },
+ {
+ id: 3,
+ name: "Publish",
+ jumlah: countPublish,
+ },
+ {
+ id: 4,
+ name: "Reject",
+ jumlah: countReject,
+ },
+ ];
+
const tableBody = investasi.map((e) => (
| {e.title} |
@@ -79,9 +88,11 @@ export default function Admin_Investasi({
return (
<>
+ Investasi
+
{listBox.map((e) => (
-
+
@@ -98,7 +109,7 @@ export default function Admin_Investasi({
))}
-
+
List Investasi
diff --git a/src/app_modules/admin/main/layout.tsx b/src/app_modules/admin/main/layout.tsx
index 568b7a1b..dfd23766 100644
--- a/src/app_modules/admin/main/layout.tsx
+++ b/src/app_modules/admin/main/layout.tsx
@@ -39,7 +39,7 @@ export default function AdminLayout({
const theme = useMantineTheme();
const [opened, setOpened] = useState(false);
const router = useRouter();
- // const [active, setActive] = useState(false)
+ const [active, setActive] = useState(1);
const listAdminPage = [
{
@@ -67,12 +67,19 @@ export default function AdminLayout({
asideOffsetBreakpoint="sm"
navbar={
-
+
{listAdminPage.map((e) => (
{
+ // setActive(e.id);
router.push(e.route);
}}
/>
@@ -105,8 +112,8 @@ export default function AdminLayout({
{/* Web View */}
- HIPMI
- Dashboard Admin
+ Dashboard Admin
+ HIPMI
{/*
{listAdminPage.map((e) => (
router.push(e.route)}>
@@ -120,6 +127,8 @@ export default function AdminLayout({
}
>
+ {/* {JSON.stringify(active)} */}
+
{children}
setOpened(false)} size={"50%"}>
diff --git a/src/app_modules/auth/login/view.tsx b/src/app_modules/auth/login/view.tsx
index 66c90951..023029ee 100644
--- a/src/app_modules/auth/login/view.tsx
+++ b/src/app_modules/auth/login/view.tsx
@@ -38,7 +38,7 @@ export default function Login() {
})
.then((res) => res.json())
.then((val) => {
- console.log(val);
+ // console.log(val);
if (val.success === true) {
router.push(RouterAdminDashboard.splash_admin);
} else {