1+ import { Skeleton } from "@/components/ui/skeleton" ;
2+
13export function SchemaExplorerPanelLoadingState ( ) {
24 return (
35 < div className = "h-full flex flex-col bg-background text-foreground overflow-hidden animate-pulse" >
46 { /* ── Header (breadcrumb + actions) ── */ }
57 < div className = "shrink-0 border-b border-border/40 bg-background/90 px-4 py-2 flex items-center justify-between gap-3" >
68 < div className = "flex items-center gap-2" >
7- < div className = "h-3.5 w-20 rounded-full bg-muted/60" />
8- < div className = "h-3 w-1 rounded-full bg-muted/40" />
9- < div className = "h-3.5 w-28 rounded-full bg-muted/70" />
9+ < Skeleton className = "h-3.5 w-20 rounded-full bg-muted/60" />
10+ < Skeleton className = "h-3 w-1 rounded-full bg-muted/40" />
11+ < Skeleton className = "h-3.5 w-28 rounded-full bg-muted/70" />
1012 </ div >
1113 < div className = "flex items-center gap-2" >
12- < div className = "h-7 w-32 rounded-md bg-muted/50" />
13- < div className = "h-7 w-28 rounded-md bg-primary/20" />
14+ < Skeleton className = "h-7 w-32 rounded-md bg-muted/50" />
15+ < Skeleton className = "h-7 w-28 rounded-md bg-primary/20" />
1416 </ div >
1517 </ div >
1618
@@ -22,17 +24,17 @@ export function SchemaExplorerPanelLoadingState() {
2224
2325 { /* Database root node */ }
2426 < div className = "flex items-center gap-1.5 px-2 py-1.5 rounded-md" >
25- < div className = "h-3 w-3 rounded bg-primary/40" />
26- < div className = "h-3 w-24 rounded-full bg-muted/70" />
27- < div className = "ml-auto h-4 w-16 rounded-full bg-muted/40" />
27+ < Skeleton className = "h-3 w-3 rounded bg-primary/40" />
28+ < Skeleton className = "h-3 w-24 rounded-full bg-muted/70" />
29+ < Skeleton className = "ml-auto h-4 w-16 rounded-full bg-muted/40" />
2830 </ div >
2931
3032 { /* Schema node (expanded) */ }
3133 < div className = "flex items-center gap-1.5 px-2 py-1.5 pl-4 rounded-md" >
32- < div className = "h-2.5 w-2.5 rounded bg-muted/50" />
33- < div className = "h-3 w-3 rounded bg-primary/30" />
34- < div className = "h-3 w-20 rounded-full bg-muted/65" />
35- < div className = "ml-auto h-4 w-6 rounded-full bg-muted/40" />
34+ < Skeleton className = "h-2.5 w-2.5 rounded bg-muted/50" />
35+ < Skeleton className = "h-3 w-3 rounded bg-primary/30" />
36+ < Skeleton className = "h-3 w-20 rounded-full bg-muted/65" />
37+ < Skeleton className = "ml-auto h-4 w-6 rounded-full bg-muted/40" />
3638 </ div >
3739
3840 { /* Table rows under schema */ }
@@ -42,12 +44,12 @@ export function SchemaExplorerPanelLoadingState() {
4244 "w-22" , "w-26" , "w-32" , "w-18" , "w-16" ,
4345 ] . map ( ( w , i ) => (
4446 < div key = { i } className = "flex items-center gap-1.5 px-2 py-1 pl-8 rounded-md" >
45- < div className = "h-2.5 w-2.5 rounded bg-muted/40 shrink-0" />
46- < div className = "h-2.5 w-3.5 rounded bg-primary/25 shrink-0" />
47- < div className = { `h-2.5 ${ w } rounded-full bg-muted/55` } />
47+ < Skeleton className = "h-2.5 w-2.5 rounded bg-muted/40 shrink-0" />
48+ < Skeleton className = "h-2.5 w-3.5 rounded bg-primary/25 shrink-0" />
49+ < Skeleton className = { `h-2.5 ${ w } rounded-full bg-muted/55` } />
4850 { /* Occasional FK badge */ }
4951 { i === 7 && (
50- < div className = "ml-auto h-3.5 w-7 rounded-full bg-primary/20 text-[9px]" />
52+ < Skeleton className = "ml-auto h-3.5 w-7 rounded-full bg-primary/20 text-[9px]" />
5153 ) }
5254 </ div >
5355 ) ) }
@@ -58,13 +60,12 @@ export function SchemaExplorerPanelLoadingState() {
5860
5961 { /* DB title row */ }
6062 < div className = "flex items-center gap-3" >
61- < div className = "h-8 w-8 rounded-full bg-primary/20 shrink-0" />
63+ < Skeleton className = "h-8 w-8 rounded-full bg-primary/20 shrink-0" />
6264 < div className = "space-y-1.5" >
63- < div className = "h-5 w-32 rounded-full bg-muted/70" />
64- < div className = "h-3 w-16 rounded-full bg-muted/40" />
65+ < Skeleton className = "h-5 w-32 rounded-full bg-muted/70" />
66+ < Skeleton className = "h-3 w-16 rounded-full bg-muted/40" />
6567 </ div >
6668 </ div >
67-
6869 { /* 2 × 3 stat cards grid */ }
6970 < div className = "grid grid-cols-3 gap-3" >
7071 { [
@@ -80,9 +81,9 @@ export function SchemaExplorerPanelLoadingState() {
8081 className = "rounded-lg border border-border/30 bg-card/50 p-4 space-y-2"
8182 >
8283 { /* Big number */ }
83- < div className = { `h-7 ${ card . w } rounded-md bg-muted/70` } />
84+ < Skeleton className = { `h-7 ${ card . w } rounded-md bg-muted/70` } />
8485 { /* Label */ }
85- < div className = { `h-2.5 ${ card . label } rounded-full bg-muted/40` } />
86+ < Skeleton className = { `h-2.5 ${ card . label } rounded-full bg-muted/40` } />
8687 </ div >
8788 ) ) }
8889 </ div >
@@ -92,10 +93,10 @@ export function SchemaExplorerPanelLoadingState() {
9293 { /* ── Footer ── */ }
9394 < div className = "shrink-0 border-t border-border/40 bg-card/50 px-4 py-1.5 flex items-center justify-between" >
9495 < div className = "flex items-center gap-3" >
95- < div className = "h-3 w-36 rounded-full bg-muted/50" />
96+ < Skeleton className = "h-3 w-36 rounded-full bg-muted/50" />
9697 < div className = "h-4 w-10 rounded-full bg-emerald-500/25" />
9798 </ div >
98- < div className = "h-3 w-64 rounded-full bg-muted/30" />
99+ < Skeleton className = "h-3 w-64 rounded-full bg-muted/30" />
99100 </ div >
100101 </ div >
101102 )
0 commit comments