Improve MineGeo interface and functionality

This commit is contained in:
2026-10-06 19:24:41 +05:00
parent 7404f1dc1c
commit 233e4d57f0
67 changed files with 3053 additions and 643 deletions

View File

@@ -1,4 +1,6 @@
"use client";
import { useI18n } from "@/components/I18nProvider";
import { useEffect, useRef, useState } from "react";
import type * as Leaflet from "leaflet";
import "leaflet/dist/leaflet.css";
@@ -23,6 +25,7 @@ export function GuessMap({
onError?: (message: string) => void;
disabled?: boolean;
}) {
const { t } = useI18n();
const root = useRef<HTMLDivElement>(null),
markers = useRef<Leaflet.LayerGroup | null>(null),
lib = useRef<typeof Leaflet | null>(null),
@@ -177,18 +180,20 @@ export function GuessMap({
role="application"
aria-label={
disabled
? "Minecraft map. North is up."
: "Minecraft map. North is up. Click to place a guess, or use arrow keys to pan and Enter to pin the center."
? t("Minecraft map. North is up.")
: t(
"Minecraft map. North is up. Click to place a guess, or use arrow keys to pan and Enter to pin the center.",
)
}
/>
{error && (
<div className="map-load-error" role="alert">
<p>{error}</p>
<p>{t(error)}</p>
<button
className="button"
onClick={() => setAttempt((value) => value + 1)}
>
Retry map
{t("Retry map")}
</button>
</div>
)}