fix investasi:
- beranda progress - admin publish and reject button
This commit is contained in:
@@ -1,14 +1,9 @@
|
||||
import { Admin_KonfirmasiInvestasi } from "@/app_modules/admin/investasi";
|
||||
import { adminInvestasi_getOneById } from "@/app_modules/admin/investasi/fun";
|
||||
|
||||
export default async function Page() {
|
||||
// const investasiId = params.id;
|
||||
// const dataInvestasi = await adminInvestasi_getOneById({investasiId});
|
||||
// console.log(dataUser)
|
||||
|
||||
return (
|
||||
<>
|
||||
<Admin_KonfirmasiInvestasi />
|
||||
<Admin_KonfirmasiInvestasi />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
import { Investasi_ViewBerandaNew } from "@/app_modules/investasi/_ui";
|
||||
|
||||
export default async function Page() {
|
||||
// const allData = await investasi_funGetAllPublish({ page: 1 });
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* <Investasi_UiBeranda dataInvestasi={allData as any} /> */}
|
||||
<Investasi_ViewBerandaNew />
|
||||
</>
|
||||
);
|
||||
|
||||
46
src/app/zCoba/pdf/_view.tsx
Normal file
46
src/app/zCoba/pdf/_view.tsx
Normal file
@@ -0,0 +1,46 @@
|
||||
"use client";
|
||||
|
||||
import { Button } from "@mantine/core";
|
||||
|
||||
interface DownloadButtonProps {
|
||||
fileUrl: string;
|
||||
fileName: string;
|
||||
}
|
||||
|
||||
export default function Coba() {
|
||||
const fileUrl =
|
||||
"https://wibu-storage.wibudev.com/api/pdf-to-image?url=https://wibu-storage.wibudev.com/api/files/cm7liew81000t3y8ax1v6yo02";
|
||||
const fileName = "example.pdf"; // Nama file yang akan diunduh
|
||||
|
||||
return (
|
||||
<div>
|
||||
<h1>Download File Example</h1>
|
||||
<DownloadButton fileUrl={fileUrl} fileName={fileName} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function DownloadButton({ fileUrl, fileName }: DownloadButtonProps) {
|
||||
const handleDownloadFromAPI = async () => {
|
||||
try {
|
||||
const response = await fetch("https://wibu-storage.wibudev.com/api/files/cm7liew81000t3y8ax1v6yo02")
|
||||
const blob = await response.blob(); // Konversi respons ke Blob
|
||||
const url = window.URL.createObjectURL(blob); // Buat URL untuk Blob
|
||||
const link = document.createElement("a");
|
||||
link.href = url;
|
||||
link.download = "generated-file.pdf"; // Nama file yang akan diunduh
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
window.URL.revokeObjectURL(url); // Bersihkan URL
|
||||
} catch (error) {
|
||||
console.error("Error downloading file:", error);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Button onClick={handleDownloadFromAPI} variant="outline" color="blue">
|
||||
Download File
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
13
src/app/zCoba/pdf/page.tsx
Normal file
13
src/app/zCoba/pdf/page.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import Coba from "./_view";
|
||||
|
||||
|
||||
|
||||
async function Page() {
|
||||
return (
|
||||
<>
|
||||
<Coba />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default Page;
|
||||
Reference in New Issue
Block a user