Fix All Image Add Lazy Loading
This commit is contained in:
@@ -51,9 +51,9 @@ export default function EditPegawaiPPID() {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
stateStrukturPPID.posisiOrganisasi.findMany.load();
|
||||
const loadPegawai = async () => {
|
||||
try {
|
||||
await stateStrukturPPID.posisiOrganisasi.findMany.load(1, 0); // ambil semua data
|
||||
const data = await stateOrganisasi.edit.load(id);
|
||||
if (data) {
|
||||
setFormData({
|
||||
@@ -81,6 +81,8 @@ export default function EditPegawaiPPID() {
|
||||
);
|
||||
}
|
||||
};
|
||||
console.log('Current posisiId:', formData.posisiId);
|
||||
console.log('Available positions:', stateStrukturPPID.posisiOrganisasi.findMany.data?.map(p => p.id));
|
||||
|
||||
loadPegawai();
|
||||
}, [id]);
|
||||
@@ -223,6 +225,7 @@ export default function EditPegawaiPPID() {
|
||||
alt="Preview Gambar"
|
||||
radius="md"
|
||||
style={{ maxHeight: 220, objectFit: 'contain', border: `1px solid ${colors['blue-button']}` }}
|
||||
loading='lazy'
|
||||
/>
|
||||
</Box>
|
||||
)}
|
||||
@@ -314,7 +317,7 @@ export default function EditPegawaiPPID() {
|
||||
boxShadow: '0 4px 15px rgba(79, 172, 254, 0.4)',
|
||||
}}
|
||||
>
|
||||
Simpan Perubahan
|
||||
Simpan
|
||||
</Button>
|
||||
</Group>
|
||||
</Stack>
|
||||
|
||||
@@ -17,6 +17,7 @@ function DetailPegawai() {
|
||||
const router = useRouter();
|
||||
|
||||
useShallowEffect(() => {
|
||||
stateStrukturPPID.posisiOrganisasi.findMany.load();
|
||||
statePegawai.findUnique.load(params?.id as string);
|
||||
}, []);
|
||||
|
||||
@@ -117,6 +118,7 @@ function DetailPegawai() {
|
||||
border: '1px solid #e0e0e0',
|
||||
borderRadius: '8px',
|
||||
}}
|
||||
loading='lazy'
|
||||
/>
|
||||
) : (
|
||||
<Text fz="sm" c="dimmed" mt="sm">Tidak ada foto profil</Text>
|
||||
|
||||
@@ -16,7 +16,7 @@ function CreatePegawaiPPID() {
|
||||
const [previewImage, setPreviewImage] = useState<{ preview: string; file: File } | null>(null);
|
||||
const stateOrganisasi = useProxy(stateStrukturPPID.pegawai)
|
||||
useEffect(() => {
|
||||
stateStrukturPPID.posisiOrganisasi.findMany.load();
|
||||
stateStrukturPPID.posisiOrganisasi.findMany.load(1, 0);
|
||||
resetForm();
|
||||
}, []);
|
||||
|
||||
@@ -183,6 +183,7 @@ function CreatePegawaiPPID() {
|
||||
border: '1px solid #e0e0e0',
|
||||
borderRadius: '8px',
|
||||
}}
|
||||
loading='lazy'
|
||||
/>
|
||||
</Box>
|
||||
)}
|
||||
|
||||
@@ -59,10 +59,10 @@ function ListPegawaiPPID({ search }: { search: string }) {
|
||||
<Group justify="space-between" mb="md">
|
||||
<Title order={4}>Daftar Pegawai PPID</Title>
|
||||
<Tooltip label="Tambah Pegawai Baru" withArrow>
|
||||
<Button
|
||||
leftSection={<IconPlus size={18} />}
|
||||
color="blue"
|
||||
variant="light"
|
||||
<Button
|
||||
leftSection={<IconPlus size={18} />}
|
||||
color="blue"
|
||||
variant="light"
|
||||
onClick={() => router.push('/admin/ppid/struktur-ppid/pegawai/create')}
|
||||
>
|
||||
Tambah Baru
|
||||
@@ -82,10 +82,10 @@ function ListPegawaiPPID({ search }: { search: string }) {
|
||||
<Group justify="space-between" mb="md">
|
||||
<Title order={4}>Daftar Pegawai PPID</Title>
|
||||
<Tooltip label="Tambah Pegawai Baru" withArrow>
|
||||
<Button
|
||||
leftSection={<IconPlus size={18} />}
|
||||
color="blue"
|
||||
variant="light"
|
||||
<Button
|
||||
leftSection={<IconPlus size={18} />}
|
||||
color="blue"
|
||||
variant="light"
|
||||
onClick={() => router.push('/admin/ppid/struktur-ppid/pegawai/create')}
|
||||
>
|
||||
Tambah Baru
|
||||
@@ -152,12 +152,14 @@ function ListPegawaiPPID({ search }: { search: string }) {
|
||||
</TableTd>
|
||||
<TableTd>
|
||||
<Button
|
||||
size="xs"
|
||||
radius="md"
|
||||
variant="light"
|
||||
color="blue"
|
||||
leftSection={<IconDeviceImacCog size={16} />}
|
||||
onClick={() => router.push(`/admin/ppid/struktur-ppid/pegawai/${item.id}`)}
|
||||
size="sm"
|
||||
>
|
||||
<IconDeviceImacCog size={20} />
|
||||
Detail
|
||||
</Button>
|
||||
</TableTd>
|
||||
</TableTr>
|
||||
|
||||
@@ -118,6 +118,7 @@ function nodeTemplate(node: any) {
|
||||
style={{
|
||||
border: '1px solid #D3D1D1FF',
|
||||
}}
|
||||
loading='lazy'
|
||||
/>
|
||||
</Tooltip>
|
||||
<Text fw={600} ta="center" size="sm">{name}</Text>
|
||||
|
||||
Reference in New Issue
Block a user