import { Card } from "@/app/components/card"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/app/components/ui/table"; import { cn } from "@/common/utils"; import { getMojangEndpointStatus } from "mcutils-library"; import { CachedEndpointStatus } from "mcutils-library/dist/types/cache/cachedEndpointStatus"; import Link from "next/link"; async function getData(): Promise { const status = await getMojangEndpointStatus(); return status; } /** * Gets the color of the status * * @param status the status of the endpoint * @returns the color of the status */ function getColor(status: any): string { switch (status) { case "ONLINE": return "text-green-500"; case "DEGRADED": return "text-yellow-500"; case "OFFLINE": return "text-red-500"; default: return "text-gray-500"; } } export default async function Page(): Promise { const { endpoints } = await getData(); const endpointsSize = Object.entries(endpoints).length; return (

Mojang Status

The current status of Mojang Services

{endpointsSize === 0 &&

Unable to fetch endpoint statuses

} {endpointsSize > 0 && ( Service Status {Object.entries(endpoints).map(([url, status]) => { return ( {url} {status} ); })}
)}
); }