({
initialStats = EMPTY_LIVE_STATS,
}: {
initialStats?: FreebuffLiveStats
})
| 358 | } |
| 359 | |
| 360 | export function CompactLiveStats({ |
| 361 | initialStats = EMPTY_LIVE_STATS, |
| 362 | }: { |
| 363 | initialStats?: FreebuffLiveStats |
| 364 | }) { |
| 365 | const stats = useLiveStats(initialStats, { refreshOnMount: true }) |
| 366 | const isLoading = stats.generatedAt === EMPTY_LIVE_STATS.generatedAt |
| 367 | |
| 368 | return ( |
| 369 | <section className="relative overflow-hidden bg-black py-14 md:py-20"> |
| 370 | <div className="absolute inset-0 bg-[linear-gradient(rgba(124,255,63,0.04)_1px,transparent_1px),linear-gradient(90deg,rgba(34,211,238,0.035)_1px,transparent_1px)] bg-[size:56px_56px]" /> |
| 371 | <div className="relative container mx-auto px-4"> |
| 372 | <div className="mb-6 flex flex-col gap-3 md:mb-8 md:flex-row md:items-end md:justify-between"> |
| 373 | <div> |
| 374 | <div className="flex items-center gap-3"> |
| 375 | <motion.span |
| 376 | className="h-2.5 w-2.5 rounded-full bg-acid-matrix shadow-[0_0_20px_rgba(124,255,63,0.95)]" |
| 377 | animate={{ opacity: [0.45, 1, 0.45], scale: [0.8, 1.2, 0.8] }} |
| 378 | transition={{ |
| 379 | duration: 1.9, |
| 380 | repeat: Infinity, |
| 381 | ease: 'easeInOut', |
| 382 | }} |
| 383 | /> |
| 384 | <span className="font-mono text-xs uppercase tracking-[0.22em] text-white/48"> |
| 385 | Active users |
| 386 | </span> |
| 387 | </div> |
| 388 | <div className="mt-2 font-mono text-5xl font-medium leading-none text-acid-matrix neon-text md:text-7xl"> |
| 389 | {isLoading ? '...' : stats.totalLiveUsers.toLocaleString()} |
| 390 | </div> |
| 391 | </div> |
| 392 | </div> |
| 393 | |
| 394 | <WorldMap stats={stats} compact isLoading={isLoading} /> |
| 395 | </div> |
| 396 | </section> |
| 397 | ) |
| 398 | } |
| 399 | |
| 400 | function ModelBars({ stats }: { stats: FreebuffLiveStats }) { |
| 401 | const maxCount = Math.max(1, ...stats.models.map((model) => model.count)) |
nothing calls this directly
no test coverage detected