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,17 @@ import {
ScrollArea,
Table,
Tooltip,
Stack,
Group,
Avatar,
Text,
Center,
} from "@mantine/core";
import { IconEdit } from "@tabler/icons-react";
import { IconChevronLeft, IconEdit } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
export default function TableReview({
export default function Admin_TableReviewInvestasi({
dataInvestsi,
}: {
dataInvestsi: MODEL_Investasi[];
@@ -23,17 +29,28 @@ export default function TableReview({
const tableBody = investasi.map((e) =>
e.MasterStatusInvestasi.id === "2" ? (
<tr key={e.id}>
<td>{e.title}</td>
<td>
{e.MasterStatusInvestasi.id === "2" ? (
<Badge variant="dot" color="orange">
{e.MasterStatusInvestasi.name}
</Badge>
) : (
"-"
)}
<Group position="left">
<Avatar variant="outline" radius={"xl"} />
<Text>{e.author.username}</Text>
</Group>
</td>
<td>
{e.title}
</td>
<td>
<Center>
{e.ProspektusInvestasi === null ? (
<Badge color="red">Unavailable</Badge>
) : (
<Badge variant="dot" color="green">
Available
</Badge>
)}
</Center>
</td>
<td>
<Center>
<Tooltip label="Konfirmasi" withArrow position="bottom">
<ActionIcon
variant="transparent"
@@ -41,9 +58,10 @@ export default function TableReview({
router.push(RouterAdminInvestasi.konfirmasi + `${e.id}`)
}
>
<IconEdit />
<IconEdit color="green" />
</ActionIcon>
</Tooltip>
</Center>
</td>
</tr>
) : (
@@ -52,23 +70,29 @@ export default function TableReview({
);
return (
<>
<Box my={"lg"}>
<ScrollArea w={"100%"}>
<Badge color="orange" variant="light" radius={0} size={"xl"}>
Review
</Badge>
<Table withBorder highlightOnHover>
<thead>
<tr>
<th>Nama Proyek Investasi</th>
<th>Status</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="orange" variant="light" radius={0} size={"xl"}>
Review
</Badge>
<Table withBorder highlightOnHover verticalSpacing={"md"} horizontalSpacing={"md"}>
<thead>
<tr>
<th>Username</th>
<th>Nama Proyek Investasi</th>
<th><Center>File Prospektus</Center></th>
<th><Center>Aksi</Center></th>
</tr>
</thead>
<tbody>{tableBody}</tbody>
</Table>
</ScrollArea>
</Box>
</Stack>
</>
);
}