|
1 | 1 | import React from "react"; |
2 | 2 |
|
3 | | -import classNames from "@calcom/ui/classNames"; |
4 | | -import { SkeletonAvatar, SkeletonText } from "@calcom/ui/components/skeleton"; |
| 3 | +import { SkeletonText } from "@calcom/ui/components/skeleton"; |
5 | 4 |
|
6 | 5 | function SkeletonLoader() { |
7 | 6 | return ( |
8 | | - <div className="animate-pulse"> |
9 | | - {/* Table rows with separator at the beginning */} |
10 | | - <div className="divide-subtle divide-y"> |
11 | | - {/* Month separator skeleton */} |
12 | | - <div className="bg-muted rounded-t py-2"> |
13 | | - <SkeletonItem isHeader={true} /> |
14 | | - </div> |
15 | | - <div className="bg-muted"> |
16 | | - <SkeletonText className="ml-2 mt-3 h-4 w-28 rounded" /> |
17 | | - </div> |
18 | | - |
19 | | - <SkeletonItem /> |
20 | | - <SkeletonItem /> |
21 | | - <SkeletonItem /> |
22 | | - <SkeletonItem /> |
23 | | - <SkeletonItem /> |
24 | | - </div> |
25 | | - </div> |
| 7 | + <ul className="divide-subtle border-subtle bg-default animate-pulse divide-y rounded-md border sm:overflow-hidden"> |
| 8 | + <SkeletonItem /> |
| 9 | + <SkeletonItem /> |
| 10 | + <SkeletonItem /> |
| 11 | + </ul> |
26 | 12 | ); |
27 | 13 | } |
28 | 14 |
|
29 | 15 | export default SkeletonLoader; |
30 | 16 |
|
31 | | -function SkeletonItem({ isHeader = false }: { isHeader?: boolean }) { |
| 17 | +function SkeletonItem() { |
32 | 18 | return ( |
33 | | - <div |
34 | | - className={classNames( |
35 | | - "grid grid-cols-[132px_130px_185px_150px_140px_280px] gap-6 px-2", |
36 | | - isHeader ? "py-2" : "py-2.5" |
37 | | - )}> |
38 | | - {/* Date column - 140px */} |
39 | | - <div className="flex items-center"> |
40 | | - <SkeletonText className={classNames("h-4 rounded", isHeader ? "w-12" : "w-20")} /> |
41 | | - </div> |
42 | | - |
43 | | - {/* Time column - 140px */} |
44 | | - <div className="flex items-center"> |
45 | | - <SkeletonText className={classNames("h-4 rounded", isHeader ? "w-12" : "w-28")} /> |
46 | | - </div> |
47 | | - |
48 | | - {/* Event column - 200px */} |
49 | | - <div className="flex items-center"> |
50 | | - <SkeletonText className={classNames("h-4 rounded", isHeader ? "w-16" : "w-full")} /> |
51 | | - </div> |
52 | | - |
53 | | - {/* Who column - 160px, Avatar group */} |
54 | | - <div className="flex items-center -space-x-1"> |
55 | | - {isHeader && <SkeletonText className="h-4 w-20 rounded" />} |
56 | | - {!isHeader && ( |
57 | | - <> |
58 | | - <SkeletonAvatar className="h-6 w-6 rounded-full" /> |
59 | | - <SkeletonAvatar className="h-6 w-6 rounded-full" /> |
60 | | - <SkeletonAvatar className="h-6 w-6 rounded-full" /> |
61 | | - </> |
62 | | - )} |
63 | | - </div> |
64 | | - |
65 | | - {/* Team column - 140px */} |
66 | | - <div className="flex items-center"> |
67 | | - <SkeletonText className="h-4 w-20 rounded-md" /> |
| 19 | + <li className="group flex w-full items-center justify-between px-4 py-4 sm:px-6"> |
| 20 | + <div className="flex-grow truncate text-sm"> |
| 21 | + <div className="flex"> |
| 22 | + <div className="flex flex-col space-y-2"> |
| 23 | + <SkeletonText className="h-5 w-16" /> |
| 24 | + <SkeletonText className="h-4 w-32" /> |
| 25 | + </div> |
| 26 | + </div> |
68 | 27 | </div> |
69 | | - |
70 | | - {/* Actions column - 280px */} |
71 | | - <div className="mr-2 flex items-center justify-end gap-2"> |
72 | | - {isHeader && <SkeletonText className="h-4 w-16 rounded-md" />} |
73 | | - {!isHeader && ( |
74 | | - <> |
75 | | - <SkeletonText className="h-4 w-16 rounded-md" /> |
76 | | - <SkeletonText className="h-4 w-20 rounded-md" /> |
77 | | - <SkeletonText className="h-4 w-8 rounded-md" /> |
78 | | - </> |
79 | | - )} |
| 28 | + <div className="mt-4 hidden flex-shrink-0 sm:ml-5 sm:mt-0 lg:flex"> |
| 29 | + <div className="flex justify-between space-x-2 rtl:space-x-reverse"> |
| 30 | + <SkeletonText className="h-6 w-16" /> |
| 31 | + <SkeletonText className="h-6 w-32" /> |
| 32 | + </div> |
80 | 33 | </div> |
81 | | - </div> |
| 34 | + </li> |
82 | 35 | ); |
83 | 36 | } |
0 commit comments