Prospektus Investasi
# feat: - Halaman upload - Function upload - Get data prospektus ### No issue
This commit is contained in:
@@ -1,17 +1,21 @@
|
||||
"use client";
|
||||
|
||||
import { RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
|
||||
import HeaderTamplate from "@/app_modules/component/header_tamplate";
|
||||
import { AppShell } from "@mantine/core";
|
||||
import { IconEdit } from "@tabler/icons-react";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutEditProspektusInvestasi({
|
||||
children,
|
||||
idInves
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
idInves: string
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppShell header={<HeaderTamplate title="Edit Prospektus" />}>
|
||||
<AppShell header={<HeaderTamplate title="Edit Prospektus" icon={<IconEdit/>}route2={RouterInvestasi.upload_prospektus + `${idInves}`} />}>
|
||||
{children}
|
||||
</AppShell>
|
||||
</>
|
||||
|
||||
@@ -8,54 +8,67 @@ import {
|
||||
Divider,
|
||||
Button,
|
||||
Text,
|
||||
Group,
|
||||
FileButton,
|
||||
FileInput,
|
||||
Image,
|
||||
AspectRatio,
|
||||
Flex,
|
||||
Stack,
|
||||
Box,
|
||||
} from "@mantine/core";
|
||||
import { IconChevronRight } from "@tabler/icons-react";
|
||||
import { IconChevronRight, IconFileTypePdf } from "@tabler/icons-react";
|
||||
import Link from "next/link";
|
||||
import { useState } from "react";
|
||||
import { MODEL_Investasi } from "../model/model_investasi";
|
||||
|
||||
export default function EditProspektusInvestasi() {
|
||||
const [edit, setEdit] = useState(true);
|
||||
export default function EditProspektusInvestasi({
|
||||
dataInvestasi,
|
||||
}: {
|
||||
dataInvestasi: MODEL_Investasi;
|
||||
}) {
|
||||
const [prospek, setProspek] = useState<MODEL_Investasi>(dataInvestasi);
|
||||
|
||||
return (
|
||||
<>
|
||||
{edit ? (
|
||||
<Link
|
||||
href={"/aset/dummy_file.pdf"}
|
||||
target="_blank"
|
||||
style={{ textDecorationLine: "none" }}
|
||||
>
|
||||
<Paper w={"100%"} h={50} bg={"gray"} mb={"md"}>
|
||||
<Grid
|
||||
align="center"
|
||||
justify="center"
|
||||
h={50}
|
||||
px={"sm"}
|
||||
onClick={() => ""}
|
||||
>
|
||||
<Grid.Col span={10}>
|
||||
<Text>Nama File.pdf</Text>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={2}>
|
||||
<Center>
|
||||
<IconChevronRight />
|
||||
</Center>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Paper>
|
||||
</Link>
|
||||
) : (
|
||||
<Center>
|
||||
<Title order={4}>Tidak ada file</Title>
|
||||
</Center>
|
||||
)}
|
||||
{/* <pre>{JSON.stringify(prospek, null, 2)}</pre> */}
|
||||
|
||||
<Divider mt={"lg"} />
|
||||
|
||||
<Center>
|
||||
<Button mt={"md"} compact radius={50}>
|
||||
Upload
|
||||
</Button>
|
||||
</Center>
|
||||
<Stack>
|
||||
{prospek.ProspektusInvestasi != null ? (
|
||||
<Link
|
||||
href={`/file/${prospek.ProspektusInvestasi.url}`}
|
||||
target="_blank"
|
||||
style={{ textDecorationLine: "none" }}
|
||||
>
|
||||
<Paper w={"100%"} bg={"gray"} mb={"md"}>
|
||||
<Grid
|
||||
align="center"
|
||||
justify="center"
|
||||
h={50}
|
||||
px={"sm"}
|
||||
onClick={() => ""}
|
||||
>
|
||||
<Grid.Col span={10}>
|
||||
<Group>
|
||||
<IconFileTypePdf />
|
||||
<Text>Prospektus_{prospek.title}</Text>
|
||||
</Group>
|
||||
</Grid.Col>
|
||||
<Grid.Col span={2}>
|
||||
<Center>
|
||||
<IconChevronRight />
|
||||
</Center>
|
||||
</Grid.Col>
|
||||
</Grid>
|
||||
</Paper>
|
||||
</Link>
|
||||
) : (
|
||||
<Center>
|
||||
<Title order={4}>Tidak ada file</Title>
|
||||
</Center>
|
||||
)}
|
||||
<Divider my={"lg"} />
|
||||
</Stack>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user