import type { RegionMap } from '@shared/protocol'; /** * Small bottom-left legend mapping each nation on the map to its stable color. * Rendered by the game screen as a minimal floating window over the map. */ export default function MapLegend({ regions }: { regions: RegionMap }) { const owners = new Map(); for (const r of Object.values(regions)) { if (r.ownerId && !owners.has(r.ownerId)) owners.set(r.ownerId, { color: r.color, owner: r.owner }); } const list = [...owners.entries()].sort((a, b) => a[1].owner.localeCompare(b[1].owner)); if (list.length === 0) return null; return (
Nations
); }