upd: tampil gambar

Deskripsi:
- masih blm bisa

No Issues
This commit is contained in:
2025-11-11 16:52:52 +08:00
parent 715a929e13
commit adae0d3db1
3 changed files with 58 additions and 49 deletions

View File

@@ -9,6 +9,7 @@ import {
Flex,
Grid,
Group,
Image,
Modal,
Stack,
Table,
@@ -56,6 +57,22 @@ export default function DetailPengaduanPage() {
function DetailDataPengaduan() {
const [opened, { open, close }] = useDisclosure(false);
const [catModal, setCatModal] = useState<"tolak" | "terima">("tolak");
const [imageSrc, setImageSrc] = useState<string | null>(null);
const [openedModalImage, { open: openModalImage, close: closeModalImage }] =
useDisclosure(false);
async function handleLihatGambar() {
const res = await apiFetch.api.pengaduan.image.get({
query: {
fileName: "57d5ce89-7d18-4244-9f4c-ca21b70adb7e",
},
});
console.error('client',res)
// const blob = await res.data?.blob();
// setImageSrc(URL.createObjectURL(blob!));
// openModalImage();
}
return (
<>
@@ -99,6 +116,16 @@ function DetailDataPengaduan() {
</Stack>
</Modal>
<Modal
opened={openedModalImage}
onClose={closeModalImage}
title="Gambar Pengaduan"
centered
overlayProps={{ backgroundOpacity: 0.55, blur: 3 }}
>
<Image src={imageSrc!} />
</Modal>
<Card
radius="md"
p="lg"
@@ -170,7 +197,7 @@ function DetailDataPengaduan() {
<IconPhotoScan size={20} />
<Text size="md">Gambar</Text>
</Group>
<Anchor href="https://mantine.dev/" target="_blank">
<Anchor href="#" onClick={handleLihatGambar}>
Lihat Gambar
</Anchor>
</Flex>