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

@@ -21,7 +21,7 @@ import { toast } from '@ciphera-net/ui'
import { useTheme } from '@ciphera-net/ui'
import { getAuthErrorMessage } from '@ciphera-net/ui'
import { Button, Modal } from '@ciphera-net/ui'
import { UptimeSkeleton, ChecksSkeleton } from '@/components/skeletons'
import { UptimeSkeleton, ChecksSkeleton, useMinimumLoading } from '@/components/skeletons'
import {
AreaChart,
Area,
@@ -703,7 +703,9 @@ export default function UptimePage() {
setShowEditModal(true)
}
if (loading) return <UptimeSkeleton />
const showSkeleton = useMinimumLoading(loading)
if (showSkeleton) return <UptimeSkeleton />
if (!site) return <div className="p-8 text-neutral-500">Site not found</div>
const monitors = Array.isArray(uptimeData?.monitors) ? uptimeData.monitors : []