cleanup mojang endpoint status page
Some checks failed
Deploy App / docker (ubuntu-latest) (push) Has been cancelled

This commit is contained in:
Lee 2024-04-17 19:18:32 +01:00
parent 3786ff84ad
commit 425a2b1464

@ -4,7 +4,7 @@ import { generateEmbed } from "@/common/embed";
import { capitalizeFirstLetter } from "@/common/string-utils";
import { formatTime } from "@/common/time-utils";
import { cn } from "@/common/utils";
import { CachedEndpointStatus, getMojangEndpointStatus } from "mcutils-library";
import { getMojangEndpointStatus } from "mcutils-library";
import { Metadata } from "next";
import Link from "next/link";
@ -42,13 +42,8 @@ function formatStatus(status: any): string {
return capitalizeFirstLetter(status.toLowerCase());
}
async function getData(): Promise<CachedEndpointStatus> {
const status = await getMojangEndpointStatus();
return status;
}
export async function generateMetadata(): Promise<Metadata> {
const { endpoints } = await getData();
const { endpoints } = await getMojangEndpointStatus();
let description = Object.entries(endpoints)
.map(([url, status]) => {
@ -64,7 +59,7 @@ export async function generateMetadata(): Promise<Metadata> {
}
export default async function Page(): Promise<JSX.Element> {
const { endpoints } = await getData();
const { endpoints } = await getMojangEndpointStatus();
const endpointsSize = Object.entries(endpoints).length;
return (