'use client'
import colors from '@/con/colors'
import { Box, Button, Group, Paper, Skeleton, Stack, Table, TableTbody, TableTd, TableTh, TableThead, TableTr, Text, Title } from '@mantine/core'
import { useShallowEffect } from '@mantine/hooks'
import { IconDeviceImacCog, IconId, IconInfoCircle, IconPhone, IconUser } from '@tabler/icons-react'
import { useRouter } from 'next/navigation'
import { useProxy } from 'valtio/utils'
import statepermohonanInformasiPublikForm from '../../_state/ppid/permohonan_informasi_publik/permohonanInformasiPublik'
function Page() {
const permohonanInformasiPublikState = useProxy(statepermohonanInformasiPublikForm)
const router = useRouter()
useShallowEffect(() => {
permohonanInformasiPublikState.statepermohonanInformasiPublik.findMany.load()
}, [])
if (!permohonanInformasiPublikState.statepermohonanInformasiPublik.findMany.data) {
return (
)
}
const data = permohonanInformasiPublikState.statepermohonanInformasiPublik.findMany.data
return (
Daftar Permohonan Informasi Publik
{data.length === 0 ? (
Belum ada permohonan informasi yang tercatat
) : (
No
Nama
NIK
Telepon
Detail
{data.map((item, index) => (
{index + 1}
{item.name}
{item.nik}
{item.notelp}
}
onClick={() => router.push(`/admin/ppid/permohonan-informasi-publik/${item.id}`)}
>
Detail
))}
)}
)
}
export default Page