@@ -5,7 +5,7 @@ import { useState } from "react";
55import { useQueueStatus , useWorkspaces } from "@/api/queries" ;
66import type { components } from "@/api/schema.d.ts" ;
77import { ErrorAlert } from "@/components/shared/ErrorAlert" ;
8- import { PageLoader } from "@/components/shared/LoadingSpinner " ;
8+ import { Skeleton } from "@/components/shared/Skeleton " ;
99import { Body , Muted , PageTitle , SectionHeading } from "@/components/ui/typography" ;
1010import { useDemo } from "@/hooks/useDemo" ;
1111import { COLOR } from "@/lib/constants" ;
@@ -182,7 +182,7 @@ export function Dashboard() {
182182 </ motion . div >
183183
184184 < ErrorAlert error = { error instanceof Error ? error : null } />
185- { isLoading && < PageLoader /> }
185+ { isLoading && < DashboardSkeleton /> }
186186
187187 { ! isLoading && workspaces . length > 0 && (
188188 < div className = "space-y-4" >
@@ -265,3 +265,64 @@ export function Dashboard() {
265265 </ div >
266266 ) ;
267267}
268+
269+ function DashboardSkeleton ( ) {
270+ return (
271+ < div className = "space-y-4" aria-hidden = "true" >
272+ < div className = "grid grid-cols-2 sm:grid-cols-4 gap-3" >
273+ { Array . from ( { length : 4 } ) . map ( ( _ , index ) => (
274+ < div key = { index } className = "rounded-xl p-4 theme-card" >
275+ < Skeleton accent = { index === 0 } className = "h-8 w-16 rounded-lg" />
276+ < Skeleton className = "mt-3 h-3 w-20 rounded" />
277+ </ div >
278+ ) ) }
279+ </ div >
280+
281+ < div className = "rounded-xl theme-card overflow-hidden" >
282+ < div
283+ className = "flex items-center gap-2 px-4 py-3"
284+ style = { { borderBottom : "1px solid var(--border)" } }
285+ >
286+ < Skeleton accent className = "h-4 w-4 rounded" />
287+ < Skeleton className = "h-4 w-28 rounded" />
288+ < Skeleton className = "ml-1 h-3 w-32 rounded" />
289+ </ div >
290+
291+ < div className = "overflow-x-auto" >
292+ < table className = "w-full text-xs" >
293+ < thead >
294+ < tr style = { { background : "var(--bg-3)" } } >
295+ { Array . from ( { length : 6 } ) . map ( ( _ , index ) => (
296+ < th key = { index } className = "px-4 py-2 text-left" >
297+ < Skeleton className = "h-3 w-14 rounded" />
298+ </ th >
299+ ) ) }
300+ </ tr >
301+ </ thead >
302+ < tbody >
303+ { Array . from ( { length : 5 } ) . map ( ( _ , rowIndex ) => (
304+ < tr key = { rowIndex } style = { { borderTop : "1px solid var(--border)" } } >
305+ < td className = "px-4 py-3" >
306+ < Skeleton accent className = "h-3 w-28 rounded" />
307+ </ td >
308+ < td className = "px-4 py-3" >
309+ < div className = "flex justify-end" >
310+ < Skeleton className = "h-3 w-20 rounded" />
311+ </ div >
312+ </ td >
313+ { Array . from ( { length : 4 } ) . map ( ( __ , cellIndex ) => (
314+ < td key = { cellIndex } className = "px-4 py-3" >
315+ < div className = "flex justify-end" >
316+ < Skeleton className = "h-3 w-8 rounded" />
317+ </ div >
318+ </ td >
319+ ) ) }
320+ </ tr >
321+ ) ) }
322+ </ tbody >
323+ </ table >
324+ </ div >
325+ </ div >
326+ </ div >
327+ ) ;
328+ }
0 commit comments