Files
MineGeo/components/SiteNav.tsx
pavel444-byte de0e891b62
Some checks failed
Deploy MineGeo to Dokploy / deploy (push) Failing after 3m40s
Add Void difficulty and publish changelogs
2026-10-20 14:05:01 +05:00

43 lines
1.0 KiB
TypeScript

"use client";
import { useI18n } from "@/components/I18nProvider";
import Link from "next/link";
import { usePathname } from "next/navigation";
const links = [
["/servers", "Play & maps"],
["/leaderboard", "Leaderboard"],
["/tournaments", "Tournaments"],
["/changelogs", "Changelogs"],
["/downloads", "Downloads"],
["/about", "Guide"],
["/docs", "Docs"],
] as const;
export function SiteNav({ forumUrl }: { forumUrl?: string | null }) {
const { t } = useI18n();
const pathname = usePathname();
return (
<nav aria-label={t("Main navigation")}>
{links.map(([href, label]) => (
<Link
key={href}
href={href}
aria-current={
pathname === href || pathname.startsWith(`${href}/`)
? "page"
: undefined
}
>
{t(label)}
</Link>
))}
{forumUrl && (
<a href={forumUrl} target="_blank" rel="noopener noreferrer">
{t("Forum")}
</a>
)}
</nav>
);
}