refactor: integrate useMinimumLoading hook for enhanced loading state management across multiple pages
This commit is contained in:
@@ -13,7 +13,7 @@ import Locations from '@/components/dashboard/Locations'
|
||||
import TechSpecs from '@/components/dashboard/TechSpecs'
|
||||
import PerformanceStats from '@/components/dashboard/PerformanceStats'
|
||||
import { Select, DatePicker as DatePickerModal, Captcha, DownloadIcon, ZapIcon } from '@ciphera-net/ui'
|
||||
import { DashboardSkeleton } from '@/components/skeletons'
|
||||
import { DashboardSkeleton, useMinimumLoading } from '@/components/skeletons'
|
||||
import ExportModal from '@/components/dashboard/ExportModal'
|
||||
|
||||
// Helper to get date ranges
|
||||
@@ -193,7 +193,9 @@ export default function PublicDashboardPage() {
|
||||
loadDashboard()
|
||||
}
|
||||
|
||||
if (loading && !data && !isPasswordProtected) {
|
||||
const showSkeleton = useMinimumLoading(loading && !data && !isPasswordProtected)
|
||||
|
||||
if (showSkeleton) {
|
||||
return <DashboardSkeleton />
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user