()
| 45 | } |
| 46 | |
| 47 | function Loading() { |
| 48 | const { isEditMode } = useReportChartContext(); |
| 49 | return ( |
| 50 | <div className={cn('w-full', isEditMode && 'card')}> |
| 51 | <div className="overflow-hidden"> |
| 52 | <div className="divide-y divide-def-200 dark:divide-def-800"> |
| 53 | {Array.from({ length: 10 }).map((_, index) => ( |
| 54 | <div |
| 55 | key={index as number} |
| 56 | className="relative px-4 py-3 animate-pulse" |
| 57 | > |
| 58 | <div className="relative z-10 flex flex-col gap-2"> |
| 59 | <div className="flex items-center justify-between gap-4"> |
| 60 | <div className="flex min-w-0 items-center gap-3"> |
| 61 | {/* Icon skeleton */} |
| 62 | <div className="flex h-9 w-9 shrink-0 items-center justify-center rounded-xl border bg-def-100 dark:border-def-800 dark:bg-def-900" /> |
| 63 | |
| 64 | <div className="min-w-0"> |
| 65 | {/* Rank badge skeleton */} |
| 66 | <div className="mb-1 flex items-center gap-2"> |
| 67 | <div className="h-2 w-2 rounded-full bg-def-200 dark:bg-def-700" /> |
| 68 | <div className="h-2 w-12 rounded bg-def-200 dark:bg-def-700" /> |
| 69 | </div> |
| 70 | |
| 71 | {/* Name skeleton */} |
| 72 | <div |
| 73 | className="h-4 rounded bg-def-200 dark:bg-def-700" |
| 74 | style={{ |
| 75 | width: `${Math.random() * 100 + 100}px`, |
| 76 | }} |
| 77 | /> |
| 78 | </div> |
| 79 | </div> |
| 80 | |
| 81 | {/* Count skeleton */} |
| 82 | <div className="flex shrink-0 flex-col items-end gap-1"> |
| 83 | <div className="h-5 w-16 rounded bg-def-200 dark:bg-def-700" /> |
| 84 | </div> |
| 85 | </div> |
| 86 | |
| 87 | {/* Bar skeleton */} |
| 88 | <div className="flex items-center"> |
| 89 | <div className="h-1.5 flex-1 overflow-hidden rounded-full bg-def-100 dark:bg-def-900"> |
| 90 | <div |
| 91 | className="h-full rounded-full bg-def-200 dark:bg-def-700" |
| 92 | style={{ |
| 93 | width: `${Math.random() * 60 + 20}%`, |
| 94 | }} |
| 95 | /> |
| 96 | </div> |
| 97 | </div> |
| 98 | </div> |
| 99 | </div> |
| 100 | ))} |
| 101 | </div> |
| 102 | </div> |
| 103 | </div> |
| 104 | ); |
nothing calls this directly
no test coverage detected