upd: dashboard admin
Desrkipsi: - update ttd skusaha No Issues
This commit is contained in:
@@ -1,11 +1,41 @@
|
|||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import notification from "../notificationGlobal";
|
||||||
|
|
||||||
export default function SKUsaha({ data }: { data: any }) {
|
export default function SKUsaha({ data }: { data: any }) {
|
||||||
|
const [viewImg, setViewImg] = useState<string>("");
|
||||||
const getValue = (jenis: string) =>
|
const getValue = (jenis: string) =>
|
||||||
_.upperFirst(
|
_.upperFirst(
|
||||||
data.surat.dataText.find((item: any) => item.jenis === jenis)?.value || ""
|
data.surat.dataText.find((item: any) => item.jenis === jenis)?.value || ""
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const loadImage = async () => {
|
||||||
|
try {
|
||||||
|
setViewImg("");
|
||||||
|
if (!data.setting.perbekelTTD) return;
|
||||||
|
|
||||||
|
const urlApi = '/api/pengaduan/image?folder=syarat-dokumen&fileName=' + data.setting.perbekelTTD;
|
||||||
|
// Fetch manual agar mendapatkan Response asli
|
||||||
|
const res = await fetch(urlApi);
|
||||||
|
if (!res.ok)
|
||||||
|
return notification({
|
||||||
|
title: "Error",
|
||||||
|
message: "Failed to load image sign",
|
||||||
|
type: "error",
|
||||||
|
});
|
||||||
|
const blob = await res.blob();
|
||||||
|
const url = URL.createObjectURL(blob);
|
||||||
|
|
||||||
|
setViewImg(url);
|
||||||
|
} catch (err) {
|
||||||
|
console.error("Gagal load gambar:", err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
loadImage();
|
||||||
|
}, [data]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ lineHeight: "1.3" }}>
|
<div style={{ lineHeight: "1.3" }}>
|
||||||
{/* HEADER */}
|
{/* HEADER */}
|
||||||
@@ -18,7 +48,7 @@ export default function SKUsaha({ data }: { data: any }) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* JUDUL */}
|
{/* JUDUL */}
|
||||||
<div style={{ textAlign: "center", margin: "20px 0" }}>
|
<div style={{ textAlign: "center", margin: "15px 0" }}>
|
||||||
<b><u>SURAT KETERANGAN USAHA</u></b><br />
|
<b><u>SURAT KETERANGAN USAHA</u></b><br />
|
||||||
Nomor: {data.surat.noSurat}
|
Nomor: {data.surat.noSurat}
|
||||||
</div>
|
</div>
|
||||||
@@ -102,13 +132,15 @@ export default function SKUsaha({ data }: { data: any }) {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* TANDA TANGAN */}
|
{/* TANDA TANGAN */}
|
||||||
<div style={{ marginTop: "40px", display: "flex", justifyContent: "flex-end", width: "100%" }}>
|
<div style={{ marginTop: "20px", display: "flex", justifyContent: "flex-end", width: "100%" }}>
|
||||||
<div style={{ textAlign: "center" }}>
|
<div style={{ textAlign: "center" }}>
|
||||||
|
|
||||||
<br /><br />
|
<br /><br />
|
||||||
Kepala Desa / Lurah {data.setting.desaNama}
|
Kepala Desa / Lurah {data.setting.desaNama}
|
||||||
<br /><br /><br /><br />
|
<br /><br />
|
||||||
{data.setting.perbekelNama} <br />
|
<img src={viewImg} alt="ttd perbekel" width={100} />
|
||||||
|
<br />
|
||||||
|
<u>{data.setting.perbekelNama}</u> <br />
|
||||||
NIP. {data.setting.perbekelNIP}
|
NIP. {data.setting.perbekelNIP}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user