AnalyticsDetailSkeleton.js
2 months ago
AnalyticsPageSkeleton.js
2 months ago
DashboardSkeleton.js
2 months ago
MediaHubPageSkeleton.js
1 month ago
MediaHubRowSkeleton.js
2 months ago
SettingsSectionSkeleton.js
2 months ago
SettingsSkeleton.js
2 months ago
UserAnalyticsDetailSkeleton.js
2 months ago
DashboardSkeleton.js
213 lines
| 1 | import { Skeleton, Container, Table } from "@bsf/force-ui"; |
| 2 | |
| 3 | const DashboardSkeleton = () => { |
| 4 | return ( |
| 5 | <Container |
| 6 | className="p-8" |
| 7 | gap="md" |
| 8 | direction="column" |
| 9 | > |
| 10 | {/* Main Content Section */} |
| 11 | <Container gap="md" direction={{ sm: "column", md: "row" }}> |
| 12 | {/* Left Column */} |
| 13 | <div className="relative flex flex-col gap-6 flex-1 min-w-0"> |
| 14 | {/* WelcomeBanner Skeleton */} |
| 15 | <Container |
| 16 | className="p-4 border border-solid border-border-subtle bg-background-primary rounded-xl shadow-soft-shadow overflow-clip" |
| 17 | direction={{ sm: "column", md: "row" }} |
| 18 | gap="lg" |
| 19 | align="center" |
| 20 | > |
| 21 | <Container.Item className="md:w-[60%] lg:w-[70%]"> |
| 22 | <div className="flex flex-col gap-4 px-4 py-2"> |
| 23 | <div className="flex flex-col gap-1.5"> |
| 24 | <Skeleton className="w-[200px] h-[28px] rounded-md" /> |
| 25 | <Skeleton className="w-[160px] h-[28px] rounded-md" /> |
| 26 | <Skeleton className="w-full max-w-[380px] h-[14px] rounded-full mt-2" /> |
| 27 | <Skeleton className="w-full max-w-[340px] h-[14px] rounded-full" /> |
| 28 | <Skeleton className="w-full max-w-[300px] h-[14px] rounded-full" /> |
| 29 | </div> |
| 30 | <div className="flex gap-3"> |
| 31 | <Skeleton className="w-[140px] h-[40px] rounded-md" /> |
| 32 | <Skeleton className="w-[110px] h-[40px] rounded-md" /> |
| 33 | </div> |
| 34 | </div> |
| 35 | </Container.Item> |
| 36 | <Container.Item className="shrink-0 w-full md:w-[360px] p-2"> |
| 37 | <div className="w-full aspect-video rounded-lg bg-gray-200 animate-pulse" /> |
| 38 | </Container.Item> |
| 39 | </Container> |
| 40 | |
| 41 | {/* EngagementChart Skeleton — matches Chart + [AreaChart | Summary] layout */} |
| 42 | <Container |
| 43 | containerType="flex" |
| 44 | direction="column" |
| 45 | gap="xs" |
| 46 | 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" |
| 47 | > |
| 48 | {/* Top bar: unified tabs pill + date picker */} |
| 49 | <Container.Item className="flex items-center justify-between w-full p-1"> |
| 50 | <Skeleton className="w-[150px] h-[30px] rounded-full" /> |
| 51 | <Skeleton className="w-[220px] h-[36px] rounded-sm" /> |
| 52 | </Container.Item> |
| 53 | |
| 54 | {/* Chart area + summary stat cards — matches Container.Item bg-background-secondary wrapper */} |
| 55 | <Container.Item className="w-full flex items-stretch justify-between gap-1 bg-background-secondary rounded-lg p-1"> |
| 56 | {/* Chart — single Skeleton matches EngagementAreaChart's min-height to avoid layout shift on load */} |
| 57 | <div className="flex-1 flex flex-col p-3 bg-background-primary rounded-md shadow-sm overflow-hidden"> |
| 58 | <Skeleton className="w-full h-full min-h-[248px] min-[1427px]:min-h-[228px] rounded" /> |
| 59 | </div> |
| 60 | |
| 61 | {/* Summary — matches ChartSummary (w-[30%]) + two StatCards */} |
| 62 | <div className="w-[30%] flex flex-col gap-1"> |
| 63 | <div className="flex-1 flex flex-col items-start justify-center p-3 text-left rounded-md shadow-sm bg-background-primary"> |
| 64 | <div className="flex items-center mb-1"> |
| 65 | <Skeleton className="w-3 h-3 rounded" /> |
| 66 | <Skeleton className="w-[40px] h-[10px] rounded-full ml-1" /> |
| 67 | </div> |
| 68 | <Skeleton className="w-[60px] h-[44px] rounded mt-3" /> |
| 69 | </div> |
| 70 | <div className="flex-1 flex flex-col items-start justify-center p-3 text-left rounded-md shadow-sm bg-background-primary"> |
| 71 | <div className="flex items-center mb-1"> |
| 72 | <Skeleton className="w-3 h-3 rounded" /> |
| 73 | <Skeleton className="w-[80px] h-[10px] rounded-full ml-1" /> |
| 74 | </div> |
| 75 | <Skeleton className="w-[50px] h-[44px] rounded mt-3" /> |
| 76 | </div> |
| 77 | </div> |
| 78 | </Container.Item> |
| 79 | </Container> |
| 80 | |
| 81 | {/* ExtendPlugins (inline layout) Skeleton */} |
| 82 | <div className="h-auto shadow-sm bg-background-primary rounded-xl"> |
| 83 | <Container |
| 84 | containerType="flex" |
| 85 | gap="xs" |
| 86 | direction="column" |
| 87 | className="p-3 border-solid rounded-xl border-border-subtle border-0.5 gap-1" |
| 88 | > |
| 89 | <Container.Item className="md:w-full lg:w-full"> |
| 90 | <Container className="p-1" justify="between" gap="xs" align="center"> |
| 91 | <Container.Item> |
| 92 | <Skeleton className="w-[170px] h-[16px] rounded-full" /> |
| 93 | </Container.Item> |
| 94 | </Container> |
| 95 | </Container.Item> |
| 96 | <Container.Item className="rounded-lg md:w-full lg:w-full bg-field-primary-background"> |
| 97 | <Container |
| 98 | containerType="flex" |
| 99 | direction="row" |
| 100 | className="gap-1.5 p-1" |
| 101 | > |
| 102 | {[1, 2, 3, 4].map((_, index) => ( |
| 103 | <Container.Item key={index} className="flex flex-1"> |
| 104 | <Container |
| 105 | containerType="flex" |
| 106 | direction="column" |
| 107 | className="w-full min-h-[110px] gap-1 p-1.5 rounded-md shadow-soft-shadow-inner bg-background-primary" |
| 108 | > |
| 109 | <Container.Item> |
| 110 | <Container className="items-center gap-1 p-0.5"> |
| 111 | <Container.Item className="flex" grow={0} shrink={0}> |
| 112 | <Skeleton variant="circular" className="w-4 h-4" /> |
| 113 | </Container.Item> |
| 114 | <Container.Item className="flex"> |
| 115 | <Skeleton className="w-16 h-3 rounded-full" /> |
| 116 | </Container.Item> |
| 117 | </Container> |
| 118 | </Container.Item> |
| 119 | <Container.Item className="gap-0.5 px-0.5"> |
| 120 | <Skeleton className="w-full max-w-[140px] h-3 rounded-full" /> |
| 121 | <Skeleton className="w-20 h-3 mt-1 rounded-full" /> |
| 122 | </Container.Item> |
| 123 | <Container.Item className="gap-0.5 px-0.5 pt-1 mt-auto"> |
| 124 | <Skeleton className="w-24 h-7 rounded-md" /> |
| 125 | </Container.Item> |
| 126 | </Container> |
| 127 | </Container.Item> |
| 128 | ))} |
| 129 | </Container> |
| 130 | </Container.Item> |
| 131 | </Container> |
| 132 | </div> |
| 133 | </div> |
| 134 | |
| 135 | {/* Right Column */} |
| 136 | <div className="max-w-[100%] w-full md:max-w-[33%] flex flex-col gap-7"> |
| 137 | {/* TopPerformingMedia Skeleton */} |
| 138 | <div className="h-auto p-4 flex flex-col gap-3 border-[0.5px] border-border-subtle border-solid shadow-sm bg-background-primary rounded-xl"> |
| 139 | <div className="flex items-center justify-between gap-4"> |
| 140 | <Skeleton className="w-[130px] h-[16px] rounded-full" /> |
| 141 | <div className="min-w-[180px]"> |
| 142 | <Skeleton className="w-full h-[32px] rounded-md" /> |
| 143 | </div> |
| 144 | </div> |
| 145 | <div className="overflow-hidden"> |
| 146 | <Table className="bg-background-primary"> |
| 147 | <Table.Head className="bg-background-secondary w-full"> |
| 148 | <Table.HeadCell className="px-3 py-2"> |
| 149 | <Skeleton className="w-[80px] h-[14px] rounded" /> |
| 150 | </Table.HeadCell> |
| 151 | <Table.HeadCell className="px-3 py-2 text-right w-32"> |
| 152 | <Skeleton className="w-[40px] h-[14px] rounded ml-auto" /> |
| 153 | </Table.HeadCell> |
| 154 | </Table.Head> |
| 155 | <Table.Body> |
| 156 | {[1, 2, 3, 4, 5].map((i) => ( |
| 157 | <Table.Row key={i} className="border-b border-border-subtle"> |
| 158 | <Table.Cell className="px-3 py-3"> |
| 159 | <Skeleton className="w-full h-[14px] rounded" /> |
| 160 | </Table.Cell> |
| 161 | <Table.Cell className="px-3 py-3 text-right"> |
| 162 | <Skeleton className="w-[24px] h-[14px] rounded ml-auto" /> |
| 163 | </Table.Cell> |
| 164 | </Table.Row> |
| 165 | ))} |
| 166 | </Table.Body> |
| 167 | </Table> |
| 168 | </div> |
| 169 | </div> |
| 170 | |
| 171 | {/* QuickAccess Skeleton */} |
| 172 | <div className="w-full h-auto bg-background-primary rounded-xl"> |
| 173 | <Container |
| 174 | containerType="flex" |
| 175 | direction="column" |
| 176 | className="p-3 border-0.5 border-solid rounded-xl shadow-sm border-border-subtle" |
| 177 | gap="xs" |
| 178 | > |
| 179 | <Container.Item className="p-1 md:w-full lg:w-full"> |
| 180 | <Skeleton className="w-[90px] h-[16px] rounded-full" /> |
| 181 | </Container.Item> |
| 182 | <Container.Item className="flex flex-col gap-1 p-1 rounded-lg md:w-full lg:w-full bg-field-primary-background"> |
| 183 | {["w-[72px]", "w-[120px]", "w-[108px]"].map((width, index) => ( |
| 184 | <div |
| 185 | key={index} |
| 186 | className="flex items-center gap-1 p-2 rounded-md bg-background-primary shadow-soft-shadow-inner" |
| 187 | > |
| 188 | <Container |
| 189 | containerType="flex" |
| 190 | direction="row" |
| 191 | className="items-center gap-1 p-1" |
| 192 | align="center" |
| 193 | > |
| 194 | <Container.Item className="flex items-center justify-center"> |
| 195 | <Skeleton variant="circular" className="w-4 h-4" /> |
| 196 | </Container.Item> |
| 197 | <Container.Item className="flex items-center"> |
| 198 | <Skeleton className={`${width} h-3 rounded-full`} /> |
| 199 | </Container.Item> |
| 200 | </Container> |
| 201 | </div> |
| 202 | ))} |
| 203 | </Container.Item> |
| 204 | </Container> |
| 205 | </div> |
| 206 | </div> |
| 207 | </Container> |
| 208 | </Container> |
| 209 | ); |
| 210 | }; |
| 211 | |
| 212 | export default DashboardSkeleton; |
| 213 |