diff --git a/Frontend/bun.lockb b/Frontend/bun.lockb index 7e06f58..7d3b1b6 100644 Binary files a/Frontend/bun.lockb and b/Frontend/bun.lockb differ diff --git a/Frontend/package.json b/Frontend/package.json index 138afce..e0d4415 100644 --- a/Frontend/package.json +++ b/Frontend/package.json @@ -32,7 +32,7 @@ "react-countup": "^6.5.3", "react-dom": "^18", "react-hook-form": "^7.51.3", - "restfulmc-lib": "^1.1.2", + "restfulmc-lib": "^1.1.3", "sonner": "^1.4.41", "tailwind-merge": "^2.2.2", "tailwindcss-animate": "^1.0.7" diff --git a/Frontend/src/app/(pages)/mojang/page.tsx b/Frontend/src/app/(pages)/mojang/page.tsx new file mode 100644 index 0000000..fa93a75 --- /dev/null +++ b/Frontend/src/app/(pages)/mojang/page.tsx @@ -0,0 +1,88 @@ +import { minecrafter } from "@/font/fonts"; +import { cn } from "@/lib/utils"; +import { Metadata } from "next"; +import Link from "next/link"; +import { ReactElement } from "react"; +import { + MojangServerStatus, + MojangServerStatusResponse, + getMojangServerStatus, +} from "restfulmc-lib"; + +/** + * Page metadata. + */ +export const metadata: Metadata = { + title: "Mojang Status", + description: "View the status of Mojang servers.", +}; + +/** + * The page to view the + * status of Mojang servers. + * + * @returns the page jsx + */ +const MojangStatusPage = async (): Promise => { + const { servers }: MojangServerStatusResponse = + await getMojangServerStatus(); // Get Mojang server statuses + return ( +
+ {/* Header */} +

+ Mojang Status +

+ + {/* Server Statuses */} +
+ {servers.map((server, index) => { + const status: MojangServerStatus = server.status; // The status of the server + return ( +
+
+

+ {server.name} +

+ + {server.endpoint} + +
+ + {/* Status */} +

+ {status} +

+
+ ); + })} +
+
+ ); +}; + +/** + * The styles for each status. + */ +const statusStyles: any = { + ONLINE: "text-green-500", + DEGRADED: "text-yellow-500", + OFFLINE: "text-red-500", +}; + +export default MojangStatusPage;