feat
Desc: - Fitur crowdfunding - Fitur Investasi - Fitur tambah investasi No issue
This commit is contained in:
19
src/app_modules/investasi/upload/layout.tsx
Normal file
19
src/app_modules/investasi/upload/layout.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
"use client";
|
||||
|
||||
import HeaderTamplate from "@/app_modules/component/header_tamplate";
|
||||
import { AppShell } from "@mantine/core";
|
||||
import React from "react";
|
||||
|
||||
export default function LayoutUploadGambarInvestasi({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<AppShell header={<HeaderTamplate title="Upload Gambar Investasi" />}>
|
||||
{children}
|
||||
</AppShell>
|
||||
</>
|
||||
);
|
||||
}
|
||||
39
src/app_modules/investasi/upload/view.tsx
Normal file
39
src/app_modules/investasi/upload/view.tsx
Normal file
@@ -0,0 +1,39 @@
|
||||
"use client";
|
||||
|
||||
import { Warna } from "@/app/lib/warna";
|
||||
import {
|
||||
AspectRatio,
|
||||
Button,
|
||||
Center,
|
||||
Divider,
|
||||
FileButton,
|
||||
Group,
|
||||
Image,
|
||||
Paper,
|
||||
Text,
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function UploadGambarInvestasi() {
|
||||
const [img, setImg] = useState<any | null>();
|
||||
return (
|
||||
<>
|
||||
<Group position="center">
|
||||
<FileButton
|
||||
onChange={async (files : any) => {
|
||||
const buffer = URL.createObjectURL(
|
||||
new Blob([new Uint8Array( await files.arrayBuffer())])
|
||||
);
|
||||
setImg(buffer);
|
||||
}}
|
||||
accept="image/png,image/jpeg"
|
||||
>
|
||||
{(props) => <Button {...props}>Upload image</Button>}
|
||||
</FileButton>
|
||||
</Group>
|
||||
|
||||
{img && <Image alt="" src={img}/>}
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user