diff --git a/src/app/(frontend)/map/page.tsx b/src/app/(frontend)/map/page.tsx index e95cfc5d..e396e0c4 100644 --- a/src/app/(frontend)/map/page.tsx +++ b/src/app/(frontend)/map/page.tsx @@ -1,10 +1,10 @@ import config from "@payload-config"; import { getPayload } from "payload"; -import { Fragment } from "react"; import Link from "next/link"; import type { Metadata } from "next"; import { Map as MapIcon, MapPinIcon } from "lucide-react"; import type { Campaign, Faction, Map as MapDoc, Media } from "@/payload-types"; +import { OverflowTooltip } from "@/components/frontend/map/OverflowTooltip"; import { easeStatClass, isWorldMapEntry, @@ -38,6 +38,13 @@ function tilePreviewUrls(template: string): string[] | null { ); } +interface ReadoutCell { + key: string; + value: string; + label: string; + cls?: string; +} + export default async function MapPickerPage() { const payload = await getPayload({ config: await config }); @@ -54,12 +61,15 @@ export default async function MapPickerPage() { return (
-
+

World Map

-
+
PTF Unit Command // Tactical Grid {maps.length} Active Grid{maps.length === 1 ? "" : "s"} @@ -76,7 +86,10 @@ export default async function MapPickerPage() {

) : ( -
+
{maps.map((map) => { const campaign = map.campaign && typeof map.campaign === "object" ? (map.campaign as Campaign) : null; @@ -89,92 +102,159 @@ export default async function MapPickerPage() { map.basemapMode === "tiles" && map.tileUrlTemplate ? tilePreviewUrls(map.tileUrlTemplate) : null; - const stats = [ - map.weather - ? { - key: `w-${map.id}`, - label: weatherStatLabel(map.weather), - cls: weatherStatClass(map.weather), - } - : null, - map.easeOfAccess - ? { - key: `e-${map.id}`, - label: `${map.easeOfAccess} access`, - cls: easeStatClass(map.easeOfAccess), - } - : null, - faction ? { key: `f-${map.id}`, label: faction.name, cls: "text-violet-400" } : null, - ].filter((stat) => stat !== null); + const refCode = String(map.id).padStart(3, "0"); + + // Readout footer cells: size is always known, intel fields join when set. + const cells: ReadoutCell[] = [ + { + key: `s-${map.id}`, + value: `${map.worldSizeWidth}×${map.worldSizeHeight}`, + label: "M", + }, + ]; + if (map.weather) { + cells.push({ + key: `w-${map.id}`, + value: weatherStatLabel(map.weather), + label: "WX", + cls: weatherStatClass(map.weather), + }); + } + if (map.easeOfAccess) { + cells.push({ + key: `e-${map.id}`, + value: map.easeOfAccess, + label: "Access", + cls: easeStatClass(map.easeOfAccess), + }); + } + if (faction) { + cells.push({ + key: `f-${map.id}`, + value: faction.name, + label: "Ctrl", + cls: "text-violet-400", + }); + } + return ( -
+ {/* Cover imagery: basemap photo or zoom-1 tile mosaic, dimmed under the overlays */} +
{url ? ( // eslint-disable-next-line @next/next/no-img-element ) : tileUrls ? ( -
-
-

{map.name}

- - {map.worldSizeWidth}×{map.worldSizeHeight} m - + + {/* Legibility gradient */} +