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

64 lines
2.0 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";
import { ContributionInstructions } from "@/components/ContributionInstructions";
export default async function ServerPage({
params,
}: {
params: Promise<{ id: string }>;
}) {
const { id } = await params;
const map = await getMap(id);
if (!map) 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>
<p className="map-credit">Created by {map.credit}</p>
<p className="muted">
Map ID: <code>{map.id}</code>
</p>
<div className="detail-grid">
<div>
<div className="detail-map">
<Image
src={map.mapImage || map.image || "/images/example-map.webp"}
alt={`${map.name} surface map`}
width={1024}
height={1024}
loading="eager"
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>
{map.allow_contributions && (
<ContributionInstructions
id={id}
bounds={map.bounds}
serverAddress={map.contribution_server_address}
/>
)}
</main>
<Footer />
</>
);
}