Fix image di seafile sudah tidak pakai token tapi by folder di seafile

Kasih console di page profil ppid & visi misi di Profile Desa
This commit is contained in:
2026-02-05 11:10:30 +08:00
parent 25000d0b0f
commit df154806f7
8 changed files with 274 additions and 12 deletions

View File

@@ -13,9 +13,9 @@ function VisiMisiDesa() {
state.findUnique.load('edit');
}, []);
const { data, loading } = state.findUnique;
const { data, loading, error } = state.findUnique;
if (loading || !data) {
if (loading) {
return (
<Box py="xl">
<Skeleton h={500} radius="lg" />
@@ -23,6 +23,21 @@ function VisiMisiDesa() {
);
}
if (error || !data) {
return (
<Box py="xl">
<Paper p="xl" radius="lg" shadow="md" withBorder>
<Title order={2} c="red" ta="center" mb="md">
Terjadi Kesalahan
</Title>
<Text ta="center" c="dimmed">
{error || 'Data visi dan misi desa tidak ditemukan'}
</Text>
</Paper>
</Box>
);
}
return (
<Box>
<Stack align="center" gap="xl">

View File

@@ -34,7 +34,7 @@ function Page() {
}, []);
// LOADING SKELETON
if (!allList.profile.data)
if (allList.profile.loading)
return (
<Stack bg={colors.Bg} py="xl" gap="22">
<Box px={{ base: 'md', md: 100 }}>
@@ -53,6 +53,50 @@ function Page() {
</Stack>
);
// ERROR HANDLING
if (allList.profile.error)
return (
<Stack bg={colors.Bg} py="xl" gap="22" justify="center" align="center">
<Box px={{ base: 'md', md: 100 }}>
<Paper p="xl" bg={colors['white-trans-1']} radius="lg" shadow="xl">
{allList.profile.error === "Belum ada data profil PPID yang aktif" ? (
<>
<Title order={3} ta="center" c={"orange"} fw={700}>
Data Profile PPID Belum Tersedia
</Title>
<Text ta="center" mt="md">Mohon maaf, data profil PPID belum tersedia saat ini</Text>
</>
) : (
<>
<Title order={3} ta="center" c={"red"} fw={700}>
Gagal Memuat Data Profile
</Title>
<Text ta="center" mt="md">Silakan coba beberapa saat lagi</Text>
<Text ta="center" size="sm" c={"gray"} mt="sm">
Error: {allList.profile.error}
</Text>
</>
)}
</Paper>
</Box>
</Stack>
);
// NO DATA HANDLING
if (!allList.profile.data)
return (
<Stack bg={colors.Bg} py="xl" gap="22" justify="center" align="center">
<Box px={{ base: 'md', md: 100 }}>
<Paper p="xl" bg={colors['white-trans-1']} radius="lg" shadow="xl">
<Title order={3} ta="center" c={"orange"} fw={700}>
Data Profile PPID Belum Tersedia
</Title>
<Text ta="center" mt="md">Mohon maaf, data profil PPID belum tersedia saat ini</Text>
</Paper>
</Box>
</Stack>
);
const dataArray = Array.isArray(allList.profile.data)
? allList.profile.data
: [allList.profile.data];