import { ImageResponse } from "next/og"; import { probeStatus } from "@/lib/server-status"; import { memoAsync } from "@/lib/cache"; export const dynamic = "force-dynamic"; export const size = { width: 1200, height: 630 }; export const contentType = "image/png"; export const alt = "HurkiCorgi MC — modded Minecraft server"; export default async function OGImage() { const status = await memoAsync("og-status", 60_000, async () => { try { return await probeStatus(); } catch { return { online: false, players: { online: 0, max: 0 } }; } }); const online = status.online; const players = status.players; const accent = online ? "#4ade80" : "#f87171"; const statusLabel = online ? "Online" : "Offline"; return new ImageResponse( (