From 269653ed5565821f6b949413b359eb0a6d0d059c Mon Sep 17 00:00:00 2001 From: Liam Date: Thu, 18 Apr 2024 05:37:48 +0100 Subject: [PATCH] cleanup --- .../server/[platform]/[[...hostname]]/page.tsx | 2 +- src/app/components/server/lookup-server.tsx | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/app/(pages)/server/[platform]/[[...hostname]]/page.tsx b/src/app/(pages)/server/[platform]/[[...hostname]]/page.tsx index cc54df1..d21e28e 100644 --- a/src/app/(pages)/server/[platform]/[[...hostname]]/page.tsx +++ b/src/app/(pages)/server/[platform]/[[...hostname]]/page.tsx @@ -116,7 +116,7 @@ export default async function Page({ params: { platform, hostname } }: Params):

Lookup a {invalidPlatform ? "" : capitalizeFirstLetter(platform)} Server

You can enter a server hostname to get information about the server.

- + {error && } diff --git a/src/app/components/server/lookup-server.tsx b/src/app/components/server/lookup-server.tsx index 029a435..2b88e6f 100644 --- a/src/app/components/server/lookup-server.tsx +++ b/src/app/components/server/lookup-server.tsx @@ -1,5 +1,6 @@ "use client"; +import { capitalizeFirstLetter } from "@/common/string-utils"; import { useToast } from "@/common/use-toast"; import { ServerPlatform, getServer } from "mcutils-library"; import { useRouter } from "next/navigation"; @@ -24,7 +25,7 @@ export function LookupServer({ currentPlatform }: LookupServerProps): ReactEleme * @param query the query to lookup */ const lookupServer = async (platform: ServerPlatform, query: string) => { - if (!query || query.length === 0) { + if (query == null || query.length === 0) { return; } @@ -52,14 +53,19 @@ export function LookupServer({ currentPlatform }: LookupServerProps): ReactEleme >
- - - + - Java - Bedrock + {Object.entries(ServerPlatform).map(([_, platform], index) => { + return ( + + {capitalizeFirstLetter(platform)} + + ); + })}