AnalyticsDetailSkeleton.js
3 months ago
AnalyticsPageSkeleton.js
3 months ago
DashboardSkeleton.js
3 months ago
MediaHubPageSkeleton.js
2 months ago
MediaHubRowSkeleton.js
2 months ago
SettingsSectionSkeleton.js
3 months ago
SettingsSkeleton.js
3 months ago
UserAnalyticsDetailSkeleton.js
3 months ago
AnalyticsPageSkeleton.js
147 lines
| 1 | import { Skeleton, Container, Table } from "@bsf/force-ui"; |
| 2 | |
| 3 | const AnalyticsPageSkeleton = () => { |
| 4 | return ( |
| 5 | <Container |
| 6 | className="p-8" |
| 7 | gap="md" |
| 8 | direction="column" |
| 9 | > |
| 10 | {/* Title */} |
| 11 | <Container className="w-full"> |
| 12 | <Container.Item grow={1}> |
| 13 | <Skeleton className="w-24 h-6 rounded-full" /> |
| 14 | </Container.Item> |
| 15 | </Container> |
| 16 | |
| 17 | {/* Analytics Overview Chart + Top Users side by side */} |
| 18 | <div className="flex flex-col md:flex-row gap-5 items-stretch"> |
| 19 | {/* Left: AnalyticsOverview skeleton */} |
| 20 | <div className="flex-1 min-w-0 flex"> |
| 21 | <Container |
| 22 | containerType="flex" |
| 23 | direction="column" |
| 24 | gap="xs" |
| 25 | className="w-full max-w-full min-w-0 overflow-hidden p-4 border-0.5 border-solid rounded-xl shadow-sm bg-background-primary border-border-subtle box-border" |
| 26 | > |
| 27 | {/* Top bar: unified tabs pill + date picker */} |
| 28 | <Container.Item className="flex items-center justify-between w-full p-1"> |
| 29 | <Skeleton className="w-[150px] h-[30px] rounded-full" /> |
| 30 | <Skeleton className="w-[220px] h-[36px] rounded-sm" /> |
| 31 | </Container.Item> |
| 32 | |
| 33 | {/* KPI row — single block, no dot/label specifics */} |
| 34 | <div className="px-2 py-2"> |
| 35 | <Skeleton className="w-[120px] h-[32px] rounded" /> |
| 36 | </div> |
| 37 | |
| 38 | {/* Chart area — single Skeleton matches EngagementAreaChart's min-height to avoid layout shift on load */} |
| 39 | <div className="w-full flex flex-col flex-1 p-3 overflow-hidden bg-background-primary rounded-md shadow-sm"> |
| 40 | <Skeleton className="w-full h-full min-h-[248px] min-[1427px]:min-h-[228px] rounded" /> |
| 41 | </div> |
| 42 | </Container> |
| 43 | </div> |
| 44 | |
| 45 | {/* Right: TopUsers skeleton */} |
| 46 | <div className="md:w-1/3 shrink-0 flex"> |
| 47 | <Container |
| 48 | direction="column" |
| 49 | gap="none" |
| 50 | className="w-full border border-solid border-border-subtle rounded-xl shadow-sm bg-background-primary" |
| 51 | > |
| 52 | {/* Header */} |
| 53 | <Container align="center" gap="xs" className="px-3 py-3"> |
| 54 | <Skeleton className="w-24 h-4 rounded-full" /> |
| 55 | </Container> |
| 56 | |
| 57 | {/* Table */} |
| 58 | <div className="[&>div]:rounded-none"> |
| 59 | <Table className="shadow-none border-0 rounded-none"> |
| 60 | <Table.Head className="bg-background-primary border-b-0.5"> |
| 61 | <Table.HeadCell className="w-1/3 py-2"> |
| 62 | <Skeleton className="w-[50px] h-[14px] rounded" /> |
| 63 | </Table.HeadCell> |
| 64 | <Table.HeadCell className="w-1/3 py-2"> |
| 65 | <Skeleton className="w-[70px] h-[14px] rounded" /> |
| 66 | </Table.HeadCell> |
| 67 | <Table.HeadCell className="w-1/3 py-2"> |
| 68 | <Skeleton className="w-[80px] h-[14px] rounded" /> |
| 69 | </Table.HeadCell> |
| 70 | </Table.Head> |
| 71 | <Table.Body> |
| 72 | {[1, 2, 3, 4, 5].map((i) => ( |
| 73 | <Table.Row key={i} className="border-b border-border-subtle"> |
| 74 | <Table.Cell className="w-1/3 py-3"> |
| 75 | <Skeleton className="w-full h-[14px] rounded" /> |
| 76 | </Table.Cell> |
| 77 | <Table.Cell className="w-1/3 py-2"> |
| 78 | <Skeleton className="w-[60px] h-[14px] rounded" /> |
| 79 | </Table.Cell> |
| 80 | <Table.Cell className="w-1/3 py-2"> |
| 81 | <Skeleton className="w-[50px] h-[20px] rounded-full" /> |
| 82 | </Table.Cell> |
| 83 | </Table.Row> |
| 84 | ))} |
| 85 | </Table.Body> |
| 86 | </Table> |
| 87 | </div> |
| 88 | </Container> |
| 89 | </div> |
| 90 | </div> |
| 91 | |
| 92 | {/* Bottom: TopMedia skeleton */} |
| 93 | <Container |
| 94 | direction="column" |
| 95 | gap="none" |
| 96 | className="w-full border border-solid border-border-subtle rounded-xl shadow-sm bg-background-primary" |
| 97 | > |
| 98 | {/* Header */} |
| 99 | <Container align="center" gap="xs" className="px-3 py-3"> |
| 100 | <Skeleton className="w-24 h-4 rounded-full" /> |
| 101 | </Container> |
| 102 | |
| 103 | {/* Table */} |
| 104 | <div className="[&>div]:rounded-none"> |
| 105 | <Table className="shadow-none border-0 rounded-none"> |
| 106 | <Table.Head className="bg-background-primary border-b-0.5"> |
| 107 | <Table.HeadCell className="py-2"> |
| 108 | <Skeleton className="w-[50px] h-[14px] rounded" /> |
| 109 | </Table.HeadCell> |
| 110 | <Table.HeadCell className="py-2"> |
| 111 | <Skeleton className="w-[70px] h-[14px] rounded" /> |
| 112 | </Table.HeadCell> |
| 113 | <Table.HeadCell className="py-2"> |
| 114 | <Skeleton className="w-[80px] h-[14px] rounded" /> |
| 115 | </Table.HeadCell> |
| 116 | <Table.HeadCell className="py-2" /> |
| 117 | </Table.Head> |
| 118 | <Table.Body> |
| 119 | {[1, 2, 3, 4, 5].map((i) => ( |
| 120 | <Table.Row key={i} className="border-b border-border-subtle"> |
| 121 | <Table.Cell className="py-3"> |
| 122 | <div className="flex items-center gap-3"> |
| 123 | <Skeleton className="w-[80px] h-[45px] rounded-md shrink-0" /> |
| 124 | <Skeleton className="flex-1 min-w-0 h-[14px] rounded" /> |
| 125 | </div> |
| 126 | </Table.Cell> |
| 127 | <Table.Cell className="py-2"> |
| 128 | <Skeleton className="w-[60px] h-[14px] rounded" /> |
| 129 | </Table.Cell> |
| 130 | <Table.Cell className="py-2"> |
| 131 | <Skeleton className="w-[50px] h-[20px] rounded-full" /> |
| 132 | </Table.Cell> |
| 133 | <Table.Cell className="py-2"> |
| 134 | <Skeleton className="w-[90px] h-[28px] rounded" /> |
| 135 | </Table.Cell> |
| 136 | </Table.Row> |
| 137 | ))} |
| 138 | </Table.Body> |
| 139 | </Table> |
| 140 | </div> |
| 141 | </Container> |
| 142 | </Container> |
| 143 | ); |
| 144 | }; |
| 145 | |
| 146 | export default AnalyticsPageSkeleton; |
| 147 |