|
| 1 | +import React from "react"; |
| 2 | +import { Skeleton } from "@/components/ui/skeleton"; |
| 3 | +import { Card, CardContent, CardHeader } from "@/components/ui/card"; |
| 4 | + |
| 5 | +export default function MerchantLoading() { |
| 6 | + return ( |
| 7 | + <div className="space-y-8 pb-8"> |
| 8 | + {/* Welcome Header Skeleton */} |
| 9 | + <div className="flex flex-col sm:flex-row sm:items-center justify-between gap-4"> |
| 10 | + <div className="space-y-2"> |
| 11 | + {/* Tagline */} |
| 12 | + <Skeleton className="h-3 w-28 bg-slate-200" /> |
| 13 | + {/* Title */} |
| 14 | + <Skeleton className="h-9 w-64 bg-slate-200" /> |
| 15 | + {/* Subtitle */} |
| 16 | + <Skeleton className="h-4 w-96 bg-slate-200 max-w-full" /> |
| 17 | + </div> |
| 18 | + <div> |
| 19 | + {/* Header Action Button */} |
| 20 | + <Skeleton className="h-10 w-44 rounded-xl bg-slate-200" /> |
| 21 | + </div> |
| 22 | + </div> |
| 23 | + |
| 24 | + {/* KPI Stat Cards Skeleton */} |
| 25 | + <div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4"> |
| 26 | + {Array.from({ length: 4 }).map((_, i) => ( |
| 27 | + <Card key={i} className="border border-slate-200 bg-white shadow-sm"> |
| 28 | + <CardHeader className="flex flex-row items-center justify-between pb-2"> |
| 29 | + <Skeleton className="h-3 w-24 bg-slate-200" /> |
| 30 | + <Skeleton className="h-8 w-8 rounded-lg bg-slate-200" /> |
| 31 | + </CardHeader> |
| 32 | + <CardContent className="space-y-2"> |
| 33 | + <Skeleton className="h-8 w-32 bg-slate-200" /> |
| 34 | + <Skeleton className="h-3.5 w-28 bg-slate-200" /> |
| 35 | + </CardContent> |
| 36 | + </Card> |
| 37 | + ))} |
| 38 | + </div> |
| 39 | + |
| 40 | + {/* Charts + Recent Transactions Skeleton */} |
| 41 | + <div className="grid gap-6 lg:grid-cols-7"> |
| 42 | + {/* Revenue Chart Card */} |
| 43 | + <Card className="lg:col-span-4 border border-slate-200 bg-white shadow-sm"> |
| 44 | + <CardHeader className="space-y-1"> |
| 45 | + <div className="flex items-center justify-between"> |
| 46 | + <div className="space-y-2"> |
| 47 | + <Skeleton className="h-4 w-36 bg-slate-200" /> |
| 48 | + <Skeleton className="h-3 w-56 bg-slate-200" /> |
| 49 | + </div> |
| 50 | + <Skeleton className="h-7 w-28 bg-slate-200" /> |
| 51 | + </div> |
| 52 | + </CardHeader> |
| 53 | + <CardContent className="space-y-6"> |
| 54 | + {/* Chart Area Placeholder */} |
| 55 | + <Skeleton className="h-[260px] w-full bg-slate-100/70" /> |
| 56 | + <div className="flex items-center gap-6 pt-4 border-t border-slate-100"> |
| 57 | + <div className="space-y-1.5"> |
| 58 | + <Skeleton className="h-3 w-16 bg-slate-200" /> |
| 59 | + <Skeleton className="h-4 w-28 bg-slate-200" /> |
| 60 | + </div> |
| 61 | + <div className="space-y-1.5"> |
| 62 | + <Skeleton className="h-3 w-16 bg-slate-200" /> |
| 63 | + <Skeleton className="h-4 w-20 bg-slate-200" /> |
| 64 | + </div> |
| 65 | + </div> |
| 66 | + </CardContent> |
| 67 | + </Card> |
| 68 | + |
| 69 | + {/* Recent Transactions Card */} |
| 70 | + <Card className="lg:col-span-3 border border-slate-200 bg-white shadow-sm"> |
| 71 | + <CardHeader> |
| 72 | + <div className="flex items-center justify-between"> |
| 73 | + <Skeleton className="h-4 w-28 bg-slate-200" /> |
| 74 | + <Skeleton className="h-6 w-16 bg-slate-200" /> |
| 75 | + </div> |
| 76 | + </CardHeader> |
| 77 | + <CardContent> |
| 78 | + <div className="space-y-4"> |
| 79 | + {Array.from({ length: 5 }).map((_, i) => ( |
| 80 | + <div key={i} className="flex items-center gap-3"> |
| 81 | + <Skeleton className="w-9 h-9 rounded-xl bg-slate-200 flex-shrink-0" /> |
| 82 | + <div className="flex-1 space-y-2"> |
| 83 | + <Skeleton className="h-3.5 w-full max-w-[140px] bg-slate-200" /> |
| 84 | + <Skeleton className="h-3 w-full max-w-[100px] bg-slate-200" /> |
| 85 | + </div> |
| 86 | + <div className="flex flex-col items-end gap-1.5 flex-shrink-0"> |
| 87 | + <Skeleton className="h-3.5 w-12 bg-slate-200" /> |
| 88 | + <Skeleton className="h-4.5 w-16 rounded-full bg-slate-200" /> |
| 89 | + </div> |
| 90 | + </div> |
| 91 | + ))} |
| 92 | + </div> |
| 93 | + </CardContent> |
| 94 | + </Card> |
| 95 | + </div> |
| 96 | + |
| 97 | + {/* Quick Actions + Payment Link Performance Skeleton */} |
| 98 | + <div className="grid gap-6 lg:grid-cols-7"> |
| 99 | + {/* Quick Actions Card */} |
| 100 | + <Card className="lg:col-span-3 border border-slate-200 bg-white shadow-sm"> |
| 101 | + <CardHeader> |
| 102 | + <Skeleton className="h-4 w-24 bg-slate-200" /> |
| 103 | + </CardHeader> |
| 104 | + <CardContent className="grid grid-cols-2 gap-3"> |
| 105 | + {Array.from({ length: 4 }).map((_, i) => ( |
| 106 | + <div key={i} className="flex flex-col gap-3 p-4 rounded-xl border border-slate-100 bg-slate-50/50"> |
| 107 | + <Skeleton className="w-5 h-5 rounded-md bg-slate-200" /> |
| 108 | + <Skeleton className="h-3 w-20 bg-slate-200" /> |
| 109 | + </div> |
| 110 | + ))} |
| 111 | + </CardContent> |
| 112 | + </Card> |
| 113 | + |
| 114 | + {/* Payment Link Performance Card */} |
| 115 | + <Card className="lg:col-span-4 border border-slate-200 bg-white shadow-sm"> |
| 116 | + <CardHeader> |
| 117 | + <div className="flex items-center justify-between"> |
| 118 | + <Skeleton className="h-4 w-44 bg-slate-200" /> |
| 119 | + <Skeleton className="h-6 w-16 bg-slate-200" /> |
| 120 | + </div> |
| 121 | + </CardHeader> |
| 122 | + <CardContent> |
| 123 | + <div className="space-y-4"> |
| 124 | + {Array.from({ length: 3 }).map((_, i) => ( |
| 125 | + <div key={i} className="flex items-center gap-4 p-3 rounded-xl border border-slate-100"> |
| 126 | + <Skeleton className="w-10 h-10 rounded-xl bg-slate-200 flex-shrink-0" /> |
| 127 | + <div className="flex-1 space-y-2"> |
| 128 | + <Skeleton className="h-3.5 w-28 bg-slate-200" /> |
| 129 | + <Skeleton className="h-3 w-36 bg-slate-200" /> |
| 130 | + <div className="flex items-center gap-2 mt-1"> |
| 131 | + <Skeleton className="flex-1 h-1.5 rounded-full bg-slate-200" /> |
| 132 | + <Skeleton className="h-3 w-6 bg-slate-200" /> |
| 133 | + </div> |
| 134 | + </div> |
| 135 | + <div className="flex flex-col items-end gap-1.5 flex-shrink-0"> |
| 136 | + <Skeleton className="h-3.5 w-8 bg-slate-200" /> |
| 137 | + <Skeleton className="h-3 w-14 bg-slate-200" /> |
| 138 | + </div> |
| 139 | + </div> |
| 140 | + ))} |
| 141 | + </div> |
| 142 | + </CardContent> |
| 143 | + </Card> |
| 144 | + </div> |
| 145 | + </div> |
| 146 | + ); |
| 147 | +} |
0 commit comments