From bda427b688c17d96eccc6d75475930972a7ebd7f Mon Sep 17 00:00:00 2001 From: amaliadwiy Date: Thu, 20 Nov 2025 17:31:15 +0800 Subject: [PATCH] upd: dashboard admin Desrkipsi: - update ttd skusaha No Issues --- src/components/surat/SKUsaha.tsx | 40 ++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/src/components/surat/SKUsaha.tsx b/src/components/surat/SKUsaha.tsx index 3abd065..f1f6738 100644 --- a/src/components/surat/SKUsaha.tsx +++ b/src/components/surat/SKUsaha.tsx @@ -1,11 +1,41 @@ import _ from "lodash"; +import { useEffect, useState } from "react"; +import notification from "../notificationGlobal"; export default function SKUsaha({ data }: { data: any }) { + const [viewImg, setViewImg] = useState(""); const getValue = (jenis: string) => _.upperFirst( 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 (
{/* HEADER */} @@ -18,7 +48,7 @@ export default function SKUsaha({ data }: { data: any }) {
{/* JUDUL */} -
+
SURAT KETERANGAN USAHA
Nomor: {data.surat.noSurat}
@@ -102,13 +132,15 @@ export default function SKUsaha({ data }: { data: any }) {
{/* TANDA TANGAN */} -
+


Kepala Desa / Lurah {data.setting.desaNama} -



- {data.setting.perbekelNama}
+

+ ttd perbekel +
+ {data.setting.perbekelNama}
NIP. {data.setting.perbekelNIP}