update the command menu
All checks were successful
Deploy App / docker (ubuntu-latest) (push) Successful in 1m30s

This commit is contained in:
Lee 2024-04-22 17:06:50 +01:00
parent 9ba13d1160
commit e277645333
2 changed files with 5 additions and 8 deletions

@ -21,11 +21,6 @@ type Params = {
}; };
}; };
export async function getData(id: string): Promise<CachedPlayer> {
console.log("called");
return getPlayer(id);
}
export async function generateViewport({ params: { id } }: Params): Promise<Viewport> { export async function generateViewport({ params: { id } }: Params): Promise<Viewport> {
const validPlayer = await isValidPlayer(id); const validPlayer = await isValidPlayer(id);
return { return {
@ -43,7 +38,7 @@ export async function generateMetadata({ params: { id } }: Params): Promise<Meta
} }
try { try {
const { username, uniqueId, skin } = await getData(id); const { username, uniqueId, skin } = await getPlayer(id);
const headPartUrl = skin.parts.head; const headPartUrl = skin.parts.head;
return generateEmbed({ return generateEmbed({
@ -66,7 +61,7 @@ export default async function Page({ params: { id } }: Params): Promise<ReactEle
// Try and get the player to display // Try and get the player to display
try { try {
player = id ? await getData(id) : undefined; player = id ? await getPlayer(id) : undefined;
} catch (err) { } catch (err) {
error = (err as McUtilsAPIError).message; // Set the error message error = (err as McUtilsAPIError).message; // Set the error message
} }

@ -100,8 +100,10 @@ export function CommandMenu({ ...props }: ButtonProps): ReactElement {
router.push(`/docs/${page.slug}`); router.push(`/docs/${page.slug}`);
setOpen(false); setOpen(false);
}} }}
className="flex flex-col items-start gap-1"
> >
{page.title} <p className="font-semibold text-primary">{page.title}</p>
<p>{page.summary}</p>
</CommandItem> </CommandItem>
); );
})} })}