72 lines
1.9 KiB
TypeScript
72 lines
1.9 KiB
TypeScript
import { getI18n } from "@/lib/i18n";
|
|
import "server-only";
|
|
import Link from "next/link";
|
|
import { Compass, ArrowUpRight } from "lucide-react";
|
|
import { LanguageSwitcher } from "./LanguageSwitcher";
|
|
import { user } from "@/lib/supabase";
|
|
import { Brand } from "./Brand";
|
|
import { SiteNav } from "./SiteNav";
|
|
import { ReportBugButton } from "./ReportBugButton";
|
|
export async function Header() {
|
|
const { t } = await getI18n();
|
|
const account = await user();
|
|
return (
|
|
<header className="site-header">
|
|
<div className="header-inner">
|
|
<Brand />
|
|
<SiteNav />
|
|
<div className="header-actions">
|
|
<ReportBugButton />
|
|
<Link
|
|
href={account ? "/dashboard" : "/log-in"}
|
|
className="header-account"
|
|
>
|
|
{account ? t("My account") : t("Log in")} <ArrowUpRight size={15} />
|
|
</Link>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
);
|
|
}
|
|
export async function Footer() {
|
|
const { t } = await getI18n();
|
|
return (
|
|
<footer className="site-footer">
|
|
<div>
|
|
<Brand />
|
|
<p>{t("A familiar world. A whole new perspective.")}</p>
|
|
</div>
|
|
<div>
|
|
<LanguageSwitcher />
|
|
<Link href="/downloads">{t("Tools & downloads")}</Link>
|
|
<Link href="/leaderboard">{t("Leaderboard")}</Link>
|
|
<Link href="/moderation">{t("Moderation")}</Link>
|
|
</div>
|
|
<p className="disclaimer">
|
|
{t(
|
|
"An independent community project. Not affiliated with Mojang or Microsoft.",
|
|
)}
|
|
</p>
|
|
</footer>
|
|
);
|
|
}
|
|
export async function EmptyState({
|
|
title,
|
|
children,
|
|
}: {
|
|
title: string;
|
|
children: React.ReactNode;
|
|
}) {
|
|
const { t } = await getI18n();
|
|
return (
|
|
<div className="empty-state">
|
|
<Compass size={36} />
|
|
<h3>{t(title)}</h3>
|
|
<p>{children}</p>
|
|
<Link className="button primary" href="/downloads">
|
|
{t("Create the first map")} <ArrowUpRight size={16} />
|
|
</Link>
|
|
</div>
|
|
);
|
|
}
|