+
{children}
);
}
return (
-
+
(
-
+
{children}
),
diff --git a/Frontend/src/app/components/player/player-result.tsx b/Frontend/src/app/components/player/player-result.tsx
index 7dabdbd..ce4a8ce 100644
--- a/Frontend/src/app/components/player/player-result.tsx
+++ b/Frontend/src/app/components/player/player-result.tsx
@@ -1,5 +1,4 @@
import CopyButton from "@/components/copy-button";
-import { Badge } from "@/components/ui/badge";
import {
ContextMenu,
ContextMenuContent,
@@ -11,6 +10,8 @@ import Image from "next/image";
import Link from "next/link";
import { ReactElement } from "react";
import { CachedPlayer, SkinPart } from "restfulmc-lib";
+import CodeDialog from "@/components/code/code-dialog";
+import RawJsonBadge from "@/components/raw-json-badge";
/**
* The props for a player result.
@@ -30,41 +31,35 @@ type PlayerResultProps = {
/**
* The result of a player search.
*
+ * @param query the original query to lookup this player
* @param player the player to display
* @returns the player result jsx
*/
-const PlayerResult = ({
- query,
- player: {
- uniqueId,
- username,
- skin: { parts },
- legacy,
- },
-}: PlayerResultProps): ReactElement => (
+const PlayerResult = ({ query, player }: PlayerResultProps): ReactElement => (
{/* Raw Json */}
- }
>
-
- Raw Json
-
-
+ {JSON.stringify(player, undefined, 4)}
+
+ {/* Result */}
{/* Details */}
{/* Player Head */}
@@ -72,14 +67,14 @@ const PlayerResult = ({
{/* Name, Unique ID, and Badges */}
- {username}
+ {player.username}
- {uniqueId}
+ {player.uniqueId}
{/* Legacy Badge */}
- {legacy && (
+ {player.legacy && (
Legacy
@@ -94,7 +89,7 @@ const PlayerResult = ({
{/* Skin Parts */}
- {Object.entries(parts)
+ {Object.entries(player.skin.parts)
.filter(
([part]) =>
part === SkinPart.HEAD ||
@@ -114,7 +109,7 @@ const PlayerResult = ({
)
@@ -125,11 +120,11 @@ const PlayerResult = ({
-
+
Copy Player Username
-
+
Copy Player UUID
diff --git a/Frontend/src/app/components/raw-json-badge.tsx b/Frontend/src/app/components/raw-json-badge.tsx
new file mode 100644
index 0000000..08da08b
--- /dev/null
+++ b/Frontend/src/app/components/raw-json-badge.tsx
@@ -0,0 +1,14 @@
+import { ReactElement } from "react";
+import { Badge } from "@/components/ui/badge";
+
+/**
+ * A badge for raw json.
+ *
+ * @returns the raw json badge jsx
+ */
+const RawJsonBadge = (): ReactElement => (
+
+ Raw Json
+
+);
+export default RawJsonBadge;
diff --git a/Frontend/src/app/components/server/server-result.tsx b/Frontend/src/app/components/server/server-result.tsx
index 94de3b3..327a7c6 100644
--- a/Frontend/src/app/components/server/server-result.tsx
+++ b/Frontend/src/app/components/server/server-result.tsx
@@ -7,6 +7,8 @@ import {
} from "restfulmc-lib";
import config from "@/config";
import { minecraft } from "@/font/fonts";
+import CodeDialog from "@/components/code/code-dialog";
+import RawJsonBadge from "@/components/raw-json-badge";
/**
* The props for a server result.
@@ -28,58 +30,75 @@ const ServerResult = ({ server }: ServerResultProps): ReactElement => {
const favicon: string | undefined = (server as CachedJavaMinecraftServer)
.favicon?.url; // The favicon of the server
return (
-
- {/* Favicon */}
-
+
+ {/* Result */}
+
+ {/* Favicon */}
+
- {/* Content */}
-
- {/* Name & Ping */}
-
- {server.hostname}
+ {/* Content */}
+
+ {/* Name & Ping */}
+
+ {server.hostname}
- {/* Players & Ping */}
-
-
- {server.players.online}
- /
- {server.players.max}
-
-
+ {/* Players & Ping */}
+
+
+ {server.players.online}
+ /
+ {server.players.max}
+
+
+
+
+
+ {/* MOTD */}
+
+ {server.motd.html.map(
+ (line: string, index: number): ReactElement => {
+ return (
+
+ );
+ }
+ )}
-
- {/* MOTD */}
-
- {server.motd.html.map(
- (line: string, index: number): ReactElement => {
- return (
-
- );
- }
- )}
-
+
+ {/* Raw Json */}
+ }
+ >
+ {JSON.stringify(server, undefined, 4)}
+
);
};