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

@@ -11,7 +11,7 @@ import { toast } from '@ciphera-net/ui'
import { getAuthErrorMessage } from '@ciphera-net/ui'
import { LoadingOverlay, Button } from '@ciphera-net/ui'
import { Select, DatePicker, DownloadIcon } from '@ciphera-net/ui'
import { DashboardSkeleton } from '@/components/skeletons'
import { DashboardSkeleton, useMinimumLoading } from '@/components/skeletons'
import ExportModal from '@/components/dashboard/ExportModal'
import ContentStats from '@/components/dashboard/ContentStats'
import TopReferrers from '@/components/dashboard/TopReferrers'
@@ -216,7 +216,9 @@ export default function SiteDashboardPage() {
return () => clearInterval(interval)
}, [siteId, dateRange, todayInterval, multiDayInterval, isSettingsLoaded, loadData, loadRealtime])
if (loading) {
const showSkeleton = useMinimumLoading(loading)
if (showSkeleton) {
return <DashboardSkeleton />
}