Files
MineGeo/app/servers/[id]/page.tsx

55 lines
1.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { notFound } from "next/navigation";
import Image from "next/image";
import { Header, Footer } from "@/components/Shell";
import { StartGame } from "@/components/StartGame";
import { getMap } from "@/lib/catalog";
export default async function ServerPage({
params,
}: {
params: Promise<{ id: string }>;
}) {
const { id } = await params;
let map;
try {
map = await getMap(id);
} catch {
notFound();
}
return (
<>
<Header />
<main className="section page-content">
<span className="eyebrow">
{map.source === "plugin" ? "SERVER EXPORT" : "PLAYER CONTRIBUTION"} ·
MINECRAFT 1.21.11
</span>
<h1>{map.name}</h1>
<p className="lead">{map.description}</p>
<div className="detail-grid">
<div>
<div className="detail-map">
<Image
src={map.mapImage || map.image || ""}
alt={`${map.name} surface map`}
width={1024}
height={1024}
unoptimized
/>
</div>
<div className="card-meta">
<span>{map.panorama_count} panoramas</span>
<span>Overworld surface</span>
<span>
{map.bounds.maxX - map.bounds.minX} ×{" "}
{map.bounds.maxZ - map.bounds.minZ} blocks
</span>
</div>
</div>
<StartGame datasetId={id} />
</div>
</main>
<Footer />
</>
);
}