Spaces:
Sleeping
Sleeping
Upload Skeleton.tsx
Browse files- components/Skeleton.tsx +30 -0
components/Skeleton.tsx
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
import React from 'react';
|
| 3 |
+
|
| 4 |
+
/* fix: added ...props and broad type to allow key and other standard attributes */
|
| 5 |
+
export const Skeleton = ({ className = "", ...props }: { className?: string, [key: string]: any }) => (
|
| 6 |
+
<div {...props} className={`animate-pulse bg-zinc-900 rounded-xl ${className}`}></div>
|
| 7 |
+
);
|
| 8 |
+
|
| 9 |
+
export const CardSkeleton = () => (
|
| 10 |
+
<div className="bg-zinc-950 border border-zinc-900 p-8 rounded-[2rem] space-y-4 shadow-2xl">
|
| 11 |
+
<div className="flex justify-between">
|
| 12 |
+
<Skeleton className="w-12 h-12 rounded-2xl" />
|
| 13 |
+
<Skeleton className="w-16 h-6 rounded-full" />
|
| 14 |
+
</div>
|
| 15 |
+
<Skeleton className="w-24 h-3" />
|
| 16 |
+
<Skeleton className="w-48 h-8" />
|
| 17 |
+
<Skeleton className="w-32 h-3" />
|
| 18 |
+
</div>
|
| 19 |
+
);
|
| 20 |
+
|
| 21 |
+
export const TableRowSkeleton = () => (
|
| 22 |
+
<div className="flex items-center space-x-4 py-8 px-10">
|
| 23 |
+
<Skeleton className="w-10 h-10 rounded-xl" />
|
| 24 |
+
<div className="flex-1 space-y-2">
|
| 25 |
+
<Skeleton className="w-1/4 h-4" />
|
| 26 |
+
<Skeleton className="w-1/2 h-2" />
|
| 27 |
+
</div>
|
| 28 |
+
<Skeleton className="w-24 h-6" />
|
| 29 |
+
</div>
|
| 30 |
+
);
|