Revisi Admin Investasi

# fix:
- Perbaharui tampilan
### No issue
This commit is contained in:
2023-12-05 17:09:07 +08:00
parent 089010d2e8
commit 265a869946
16 changed files with 551 additions and 227 deletions

View File

@@ -1,3 +1,4 @@
"use client";
import { RouterAdminInvestasi } from "@/app/lib/router_hipmi/router_admin";
import { MODEL_Investasi } from "@/app_modules/investasi/model/model_investasi";
import {
@@ -7,12 +8,18 @@ import {
ScrollArea,
Table,
Tooltip,
Stack,
Center,
Avatar,
Group,
Text,
} from "@mantine/core";
import { IconEdit } from "@tabler/icons-react";
import { IconChevronLeft, IconEdit } from "@tabler/icons-react";
import _ from "lodash";
import { useRouter } from "next/navigation";
import { useState } from "react";
export default function TableReject({
export default function Admin_TableRejectInvestasi({
dataInvestsi,
}: {
dataInvestsi: MODEL_Investasi[];
@@ -23,28 +30,27 @@ export default function TableReject({
const tableBody = investasi.map((e) =>
e.MasterStatusInvestasi.id === "4" ? (
<tr key={e.id}>
<td>{e.title}</td>
<td>
{e.MasterStatusInvestasi.id === "4" ? (
<Badge variant="dot" color="red">
{e.MasterStatusInvestasi.name}
</Badge>
) : (
"-"
)}
<Group position="left">
<Avatar variant="outline" radius={"xl"} />
<Text>{e.author.username}</Text>
</Group>
</td>
<td>{_.capitalize(e.title)}</td>
<td>{e.catatan}</td>
<td>
<Tooltip label="Konfirmasi" withArrow position="bottom">
<ActionIcon
variant="transparent"
onClick={() =>
router.push(RouterAdminInvestasi.konfirmasi + `${e.id}`)
}
>
<IconEdit />
</ActionIcon>
</Tooltip>
<Center>
<Tooltip label="Konfirmasi" withArrow position="bottom">
<ActionIcon
variant="transparent"
onClick={() =>
router.push(RouterAdminInvestasi.konfirmasi + `${e.id}`)
}
>
<IconEdit color="green" />
</ActionIcon>
</Tooltip>
</Center>
</td>
</tr>
) : (
@@ -54,24 +60,36 @@ export default function TableReject({
return (
<>
<Box my={"lg"}>
<ScrollArea w={"100%"}>
<Badge color="red" variant="light" radius={0} size={"xl"}>
Reject
</Badge>
<Table withBorder highlightOnHover>
<thead>
<tr>
<th>Nama Proyek Investasi</th>
<th>Status</th>
<th>Catatan</th>
<th>Aksi</th>
</tr>
</thead>
<tbody>{tableBody}</tbody>
</Table>
</ScrollArea>
</Box>
<Stack>
<ActionIcon variant="outline" onClick={() => router.back()}>
<IconChevronLeft />
</ActionIcon>
<Box>
<ScrollArea w={"100%"}>
<Badge color="red" variant="light" radius={0} size={"xl"}>
Reject
</Badge>
<Table
withBorder
highlightOnHover
verticalSpacing={"md"}
horizontalSpacing={"md"}
>
<thead>
<tr>
<th>Username</th>
<th>Nama Proyek Investasi</th>
<th>Catatan</th>
<th>
<Center>Aksi</Center>
</th>
</tr>
</thead>
<tbody>{tableBody}</tbody>
</Table>
</ScrollArea>
</Box>
</Stack>
</>
);
}