import { getI18n } from "@/lib/i18n"; import "server-only"; import Link from "next/link"; import { Compass, ArrowUpRight } from "lucide-react"; import { LanguageSwitcher } from "./LanguageSwitcher"; import { rawUser, admin, required } from "@/lib/supabase"; import { canReviewMaps, isAdministrator } from "@/shared/permissions"; import { Brand } from "./Brand"; import { SiteNav } from "./SiteNav"; import { ReportBugButton } from "./ReportBugButton"; import { ThemeToggle } from "./ThemeToggle"; import { CommunityLinks } from "./CommunityLinks"; import { forumUrl } from "@/lib/forum"; export async function Header() { const { t } = await getI18n(); const account = await rawUser(); return (
{account ? t("My account") : t("Log in")}
); } export async function Footer() { const { t } = await getI18n(); const forum = forumUrl(); const account = await rawUser(); const result = account ? await admin() .from("profiles") .select("role,account_status") .eq("id", account.id) .maybeSingle() : null; if (result?.error) required(result); const role = result?.data?.account_status === "active" ? result.data.role : undefined; return ( ); } export async function EmptyState({ title, children, }: { title: string; children: React.ReactNode; }) { const { t } = await getI18n(); return (

{t(title)}

{children}

{t("Create the first map")}
); }