/* eslint-disable @next/next/no-img-element */ import Image from "next/image"; import Link from "next/link"; import { CachedPlayer, SkinPart } from "restfulmc-lib"; import { ReactElement } from "react"; /** * The result of a player search. * * @param player the player to display * @returns the player result jsx */ const PlayerResult = ({ player: { uniqueId, username, skin: { parts }, legacy, }, }: { player: CachedPlayer; }): ReactElement => (
{/* Details */}
{/* Player Head */} {`${username}'s {/* Name, Unique ID, and Badges */}

{username}

{uniqueId} {/* Legacy Badge */} {legacy && (

Legacy

)}
{/* Skin Parts */}
{/* Header */}

Skin Parts

{/* Skin Parts */}
{Object.entries(parts) .filter( ([part]) => part === SkinPart.HEAD || part === SkinPart.FACE || part === SkinPart.BODY_FLAT ) .map(([part, url], index) => ( {`${username}'s ))}
); export default PlayerResult;