38 lines
1.0 KiB
TypeScript
38 lines
1.0 KiB
TypeScript
import { BackendClient } from "./client";
|
|
export const dynamic = "force-dynamic";
|
|
const platforms = ["youtube", "roblox", "discord", "tiktok"];
|
|
|
|
export default async function BackendPage() {
|
|
// Read current cached counts from Redis
|
|
let counts: Record<string, number | null> = {};
|
|
try {
|
|
const { getRedisClient } = await import("@/lib/redis");
|
|
const redis = await getRedisClient();
|
|
const cached = await redis.get("erika:follower_counts");
|
|
if (cached) {
|
|
counts = JSON.parse(cached);
|
|
}
|
|
} catch {
|
|
// Redis unavailable
|
|
}
|
|
|
|
const platformData = platforms.map((p) => ({
|
|
name: p,
|
|
cachedCount: counts[p] ?? null,
|
|
}));
|
|
|
|
return (
|
|
<>
|
|
<div className="p-6 space-y-6 max-w-6xl mx-auto w-full">
|
|
<div>
|
|
<h1 className="text-3xl font-bold tracking-tight">Backend</h1>
|
|
<p className="text-muted-foreground mt-1">
|
|
Follower API connections and cache management
|
|
</p>
|
|
</div>
|
|
<BackendClient platforms={platformData} />
|
|
</div>
|
|
</>
|
|
);
|
|
}
|