web: add map image to map page

This commit is contained in:
Quaternions 2025-04-04 16:01:02 -07:00
parent 66e0d22ccd
commit e858d252ab
Signed by: Quaternions
GPG Key ID: D0DF5964F79AC131
2 changed files with 34 additions and 0 deletions
web/src/app/maps/[mapId]

@ -0,0 +1,28 @@
import Image from "next/image";
import { MapInfo } from "@/app/ts/Map";
interface AssetID {
id: MapInfo["ID"];
}
function MapImage({ id }: AssetID) {
if (!id) {
return <p>Missing asset ID</p>;
}
const imageUrl = `/thumbnails/asset/${id}`;
return (
<Image
src={imageUrl}
alt="Map Thumbnail"
layout="responsive"
width={512}
height={512}
priority={true}
className="map-image"
/>
);
}
export { type AssetID, MapImage };

@ -1,6 +1,7 @@
"use client"
import { MapInfo } from "@/app/ts/Map";
import { MapImage } from "./_mapImage";
import Webpage from "@/app/_components/webpage";
import { useParams } from "next/navigation";
import Link from "next/link";
@ -46,6 +47,11 @@ export default function Map() {
<p>GameID: { map.GameID }</p>
<p>Release Date: { map.Date }</p>
<Button name="Submit A Mapfix For This Map" href={`/maps/${mapId}/fix`}/>
<aside className="review-area">
<section className="map-image-area">
<MapImage id={map.ID}/>
</section>
</aside>
</Webpage>
)
}