refactor: integrate useMinimumLoading hook for enhanced loading state management across multiple pages

This commit is contained in:
Usman Baig
2026-02-22 18:38:35 +01:00
parent c100277955
commit d571b6156f
10 changed files with 67 additions and 16 deletions

View File

@@ -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 />
}