feat(loading-state): add loading indicators and skeleton UI for data tables

- Implement loading state management across patient, doctor and satusehat lists
- Add skeleton loading UI for data tables during data fetching
- Refactor loading state variable naming for consistency
- Make search nav optional in header component
- Update icon sizing in header for better responsiveness
- Implement url search params query state at satusehat
This commit is contained in:
Khafid Prayoga
2025-08-25 13:33:28 +07:00
parent 92d6e2af10
commit 31084be5ce
5 changed files with 139 additions and 124 deletions
+5 -1
View File
@@ -20,8 +20,9 @@ const refSearchNav: RefSearchNav = {
// Loading state management
const isLoading = reactive({
summary: false,
table: false,
dataListLoading: false,
})
const recId = ref<number>(0)
const recAction = ref<string>('')
const recItem = ref<any>(null)
@@ -82,11 +83,13 @@ async function getPatientSummary() {
}
async function getPatientList() {
isLoading.dataListLoading = true
const resp = await xfetch('/api/v1/patient')
console.log('data patient', resp)
if (resp.success) {
data.value = (resp.body as Record<string, any>).data
}
isLoading.dataListLoading = false
}
onMounted(() => {
@@ -97,6 +100,7 @@ onMounted(() => {
provide('rec_id', recId)
provide('rec_action', recAction)
provide('rec_item', recItem)
provide('pull_data', isLoading)
</script>
<template>