Update player search form
All checks were successful
Deploy Frontend / docker (17, 3.8.5) (push) Successful in 3m6s

This commit is contained in:
Braydon 2024-04-16 23:10:19 -04:00
parent b89fd74515
commit 45f38396c6
4 changed files with 38 additions and 7 deletions

Binary file not shown.

@ -80,7 +80,7 @@ export const generateMetadata = async ({
const player: CachedPlayer = await getPlayer(query); // Get the player to embed
return Embed({
title: `${player.username}'s Player`,
description: "Click to view data about this player.",
description: `UUID: ${player.uniqueId}\n\nClick to view data about this player.`,
thumbnail: player.skin.parts.HEAD,
});
} catch (err) {

@ -1,6 +1,7 @@
import MinecraftButton from "@/components/minecraft-button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { redirect } from "next/navigation";
/**
@ -23,12 +24,16 @@ const PlayerSearch = ({
className="flex flex-col gap-7 justify-center items-center"
action={handleRedirect}
>
<Input
name="query"
placeholder="Username / UUID"
defaultValue={query}
maxLength={36}
/>
<div className="w-full flex flex-col gap-3">
<Label>Username or UUID</Label>
<Input
type="search"
name="query"
placeholder="Query..."
defaultValue={query}
maxLength={36}
/>
</div>
<MinecraftButton type="submit">Search</MinecraftButton>
</form>
);

@ -0,0 +1,26 @@
"use client";
import * as LabelPrimitive from "@radix-ui/react-label";
import { cva, type VariantProps } from "class-variance-authority";
import * as React from "react";
import { cn } from "@/app/lib/utils";
const labelVariants = cva(
"text-sm font-medium text-zinc-300 leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
);
const Label = React.forwardRef<
React.ElementRef<typeof LabelPrimitive.Root>,
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &
VariantProps<typeof labelVariants>
>(({ className, ...props }, ref) => (
<LabelPrimitive.Root
ref={ref}
className={cn(labelVariants(), className)}
{...props}
/>
));
Label.displayName = LabelPrimitive.Root.displayName;
export { Label };