Add MineGeo gameplay systems and interface

This commit is contained in:
2026-10-10 10:27:47 +05:00
parent bf01d9801d
commit 9af71c85c2
47 changed files with 9954 additions and 93 deletions

View File

@@ -0,0 +1,65 @@
import "server-only";
import { MessageCircle, Send, ArrowUpRight } from "lucide-react";
import { getI18n } from "@/lib/i18n";
function communityUrl(value: string | undefined, hosts: readonly string[]) {
if (!value?.trim()) return null;
try {
const url = new URL(value.trim());
if (
url.protocol !== "https:" ||
url.username ||
url.password ||
url.port ||
!hosts.includes(url.hostname) ||
url.pathname === "/"
)
return null;
return url.href;
} catch {
return null;
}
}
export async function CommunityLinks() {
const { t } = await getI18n();
const discord = communityUrl(process.env.MINEGEO_DISCORD_URL, [
"discord.gg",
"discord.com",
"www.discord.com",
"discordapp.com",
]);
const telegram = communityUrl(process.env.MINEGEO_TELEGRAM_URL, [
"t.me",
"telegram.me",
]);
if (!discord && !telegram) return null;
return (
<div className="community-links" role="group" aria-label={t("Community")}>
{discord && (
<a
className="community-link community-discord"
href={discord}
target="_blank"
rel="noopener noreferrer"
>
<MessageCircle size={18} aria-hidden="true" />
{t("Join us on Discord")}
<ArrowUpRight size={14} aria-hidden="true" />
</a>
)}
{telegram && (
<a
className="community-link community-telegram"
href={telegram}
target="_blank"
rel="noopener noreferrer"
>
<Send size={18} aria-hidden="true" />
{t("Follow us on Telegram")}
<ArrowUpRight size={14} aria-hidden="true" />
</a>
)}
</div>
);
}