|
1 | 1 | import { Replay, Warning} from "@mui/icons-material"; |
2 | 2 | import { Skeleton } from "@mui/material"; |
3 | 3 |
|
| 4 | +// 대시보드 KPI 카드용 스켈레톤 |
| 5 | +export function KPICardSkeleton({ count = 2 }) { |
| 6 | + return ( |
| 7 | + <div className="grid grid-cols-2 gap-6"> |
| 8 | + {Array.from({ length: count }).map((_, index) => ( |
| 9 | + <div key={index} className="bg-white p-6 rounded-lg border border-gray-200"> |
| 10 | + <div className="flex items-center justify-between"> |
| 11 | + <div className="flex-1"> |
| 12 | + <Skeleton variant="text" width="70%" height={20} className="mb-2" /> |
| 13 | + <Skeleton variant="text" width="40%" height={32} /> |
| 14 | + </div> |
| 15 | + <Skeleton variant="circular" width={40} height={40} /> |
| 16 | + </div> |
| 17 | + <div className="flex items-center gap-2 mt-4"> |
| 18 | + <Skeleton variant="text" width={30} height={16} /> |
| 19 | + <Skeleton variant="text" width={40} height={16} /> |
| 20 | + </div> |
| 21 | + </div> |
| 22 | + ))} |
| 23 | + </div> |
| 24 | + ); |
| 25 | +} |
| 26 | + |
| 27 | +// 차트용 스켈레톤 |
| 28 | +export function ChartSkeleton({ height = "h-64", title }) { |
| 29 | + return ( |
| 30 | + <div className="bg-white p-6 rounded-lg border border-gray-200"> |
| 31 | + {title && ( |
| 32 | + <div className="mb-4"> |
| 33 | + <Skeleton variant="text" width="40%" height={24} /> |
| 34 | + </div> |
| 35 | + )} |
| 36 | + <div className={`${height} flex items-center justify-center`}> |
| 37 | + <div className="w-full space-y-3"> |
| 38 | + <Skeleton variant="rounded" width="100%" height={40} /> |
| 39 | + <Skeleton variant="rounded" width="80%" height={40} /> |
| 40 | + <Skeleton variant="rounded" width="60%" height={40} /> |
| 41 | + <Skeleton variant="rounded" width="90%" height={40} /> |
| 42 | + </div> |
| 43 | + </div> |
| 44 | + </div> |
| 45 | + ); |
| 46 | +} |
| 47 | + |
| 48 | +// 테이블/리스트용 스켈레톤 |
| 49 | +export function TableSkeleton({ rows = 5, title }) { |
| 50 | + return ( |
| 51 | + <div className="bg-white p-6 rounded-lg border border-gray-200"> |
| 52 | + {title && ( |
| 53 | + <div className="mb-4"> |
| 54 | + <Skeleton variant="text" width="40%" height={24} /> |
| 55 | + </div> |
| 56 | + )} |
| 57 | + <div className="space-y-3"> |
| 58 | + {Array.from({ length: rows }).map((_, index) => ( |
| 59 | + <div key={index} className="flex items-center space-x-4"> |
| 60 | + <Skeleton variant="circular" width={32} height={32} /> |
| 61 | + <div className="flex-1 space-y-2"> |
| 62 | + <Skeleton variant="text" width="60%" height={16} /> |
| 63 | + <Skeleton variant="text" width="40%" height={14} /> |
| 64 | + </div> |
| 65 | + <Skeleton variant="text" width="20%" height={16} /> |
| 66 | + </div> |
| 67 | + ))} |
| 68 | + </div> |
| 69 | + </div> |
| 70 | + ); |
| 71 | +} |
| 72 | + |
| 73 | +// 위클리 스케줄용 스켈레톤 |
| 74 | +export function WeeklyScheduleSkeleton() { |
| 75 | + return ( |
| 76 | + <div className="bg-white p-6 rounded-lg border border-gray-200"> |
| 77 | + <div className="mb-4"> |
| 78 | + <Skeleton variant="text" width="40%" height={24} /> |
| 79 | + </div> |
| 80 | + <div className="space-y-4"> |
| 81 | + {Array.from({ length: 7 }).map((_, index) => ( |
| 82 | + <div key={index} className="flex items-center space-x-4"> |
| 83 | + <Skeleton variant="text" width={40} height={16} /> |
| 84 | + <div className="flex-1"> |
| 85 | + <div className="flex space-x-2"> |
| 86 | + <Skeleton variant="rounded" width={80} height={24} /> |
| 87 | + <Skeleton variant="rounded" width={100} height={24} /> |
| 88 | + <Skeleton variant="rounded" width={60} height={24} /> |
| 89 | + </div> |
| 90 | + </div> |
| 91 | + </div> |
| 92 | + ))} |
| 93 | + </div> |
| 94 | + </div> |
| 95 | + ); |
| 96 | +} |
| 97 | + |
4 | 98 | // ProjectList용 Skeleton UI |
5 | 99 | export function ProjectListSkeleton({ count = 4 }) { |
6 | 100 | return ( |
|
0 commit comments