Senin, 19 May 2025 :

Yang Sudah Di Kerjakan
- Tampilan UI Admin di menu kesehatan

Yang Akan Dikerjakan:
- API Di Menu Desa
- Tampilan UI Admin Di Menu Keamanan
This commit is contained in:
2025-05-19 17:00:43 +08:00
parent f5d68d4982
commit d3a43c72ab
84 changed files with 2634 additions and 800 deletions

View File

@@ -29,7 +29,7 @@ function ProfileList() {
<Box mb={20}>
<Text fw={"bold"} mb={5}>Preview Gambar:</Text>
<Image
src={item.imageUrl}
src={item.imageUrl ?? '/perbekel.png'}
alt="Profile"
w={200}
/>

View File

@@ -9,6 +9,8 @@ import { useProxy } from 'valtio/utils';
import stateProfilePPID from '../../_state/ppid/profile_ppid/profile_PPID';
import { useShallowEffect } from '@mantine/hooks';
import ProfileList from './listPage';
import { useState } from 'react';
import { toast } from 'react-toastify';
function Page() {
@@ -23,14 +25,16 @@ function Page() {
}
function ProfileCreate() {
const [isLoading, setIsLoading] = useState(false)
const allState = useProxy(stateProfilePPID)
// Initialize data if it doesn't exist
useShallowEffect(() => {
if (!allState.findById.data) {
if (!allState.findById.data && isLoading) {
allState.findById.initialize()
setIsLoading(false)
}
}, [])
}, [isLoading])
const submit = () => {
if (
@@ -41,6 +45,12 @@ function ProfileCreate() {
allState.findById.data?.unggulan
) {
allState.update.save(allState.findById.data)
setIsLoading(true)
toast.success("success")
console.log("[SUBMIT SUCCESS]", JSON.stringify(allState.findById.data, null, 2))
allState.findById.initialize()
} else {
toast.error("error")
}
}
@@ -63,8 +73,8 @@ function ProfileCreate() {
<PengalamanOrganisasi />
<ProgramKerjaUnggulan />
<Group>
<Button
bg={colors['blue-button']}
<Button
bg={colors['blue-button']}
onClick={submit}
loading={allState.update.loading}
>