@@ -7,6 +7,7 @@ import { usePuzzles } from '@/hooks/usePuzzles';
77import type { PuzzleDifficulty , PuzzleFilters } from '@/lib/types/puzzles' ;
88import { Puzzle as PuzzleIcon , Clock , Zap } from 'lucide-react' ;
99import Pagination from '@/components/ui/Pagination' ;
10+ import { EmptyState , ErrorState , LoadingState } from '@/components/ui/StateDisplay' ;
1011
1112// ─── Helpers ────────────────────────────────────────────────────────────────
1213
@@ -229,34 +230,34 @@ function PuzzleListContent() {
229230
230231 { /* Loading skeleton */ }
231232 { isLoading && (
232- < div className = "grid gap-3 sm:grid-cols-2 lg:grid-cols-3" aria-label = "Loading puzzles" >
233+ < div className = "relative min-h-[26rem] grid gap-3 sm:grid-cols-2 lg:grid-cols-3" aria-label = "Loading puzzles" >
233234 { Array . from ( { length : 6 } ) . map ( ( _ , i ) => (
234235 < div
235236 key = { i }
236237 className = "h-32 rounded-xl border border-white/5 bg-white/[0.03] animate-pulse"
237238 aria-hidden = "true"
238239 />
239240 ) ) }
241+ < div className = "absolute inset-0 flex items-center justify-center" >
242+ < LoadingState message = "Loading puzzles..." />
243+ </ div >
240244 </ div >
241245 ) }
242246
243247 { /* Error state */ }
244248 { isError && (
245- < div className = "flex flex-col items-center justify-center py-16 text-center gap-2" >
246- < p className = "text-red-400 font-medium" > Failed to load puzzles</ p >
247- < p className = "text-xs text-slate-500" >
248- { error instanceof Error ? error . message : 'Please try again later.' }
249- </ p >
250- </ div >
249+ < ErrorState
250+ message = { error instanceof Error ? error . message : 'Please try again later.' }
251+ onRetry = { ( ) => window . location . reload ( ) }
252+ />
251253 ) }
252254
253255 { /* Empty state */ }
254256 { ! isLoading && ! isError && puzzles ?. length === 0 && (
255- < div className = "flex flex-col items-center justify-center py-16 text-center gap-2" >
256- < PuzzleIcon className = "h-10 w-10 text-slate-600" />
257- < p className = "font-medium text-slate-400" > No puzzles found</ p >
258- < p className = "text-xs text-slate-600" > Try clearing your filters or adjusting your search.</ p >
259- </ div >
257+ < EmptyState
258+ title = "No puzzles found"
259+ message = "Try clearing your filters or adjusting your search."
260+ />
260261 ) }
261262
262263 { /* Puzzle grid */ }
0 commit comments