import { getI18n } from "@/lib/i18n"; import Link from "next/link"; import { redirect } from "next/navigation"; import { Header, Footer } from "@/components/Shell"; import { AccountSettings } from "@/components/AccountSettings"; import { rawUser } from "@/lib/supabase"; import { accountProfile } from "@/lib/profile"; import { Username } from "@/components/Username"; import { ShieldCheck } from "lucide-react"; export async function generateMetadata() { const { t } = await getI18n(); return { title: t("Account settings") }; } export default async function Settings({ searchParams, }: { searchParams: Promise<{ password?: string }>; }) { const { t } = await getI18n(); const account = await rawUser(); if (!account) redirect("/log-in?next=%2Fsettings"); const [profile, query] = await Promise.all([ accountProfile(account), searchParams, ]); const active = profile.account_status === "active"; const statusLabel = profile.account_status === "banned" ? "Banned" : profile.account_status === "deactivated" ? "Deactivated" : profile.account_status === "deleting" ? "Deletion pending" : "Active"; return ( <>
{t(active ? "← My account" : "← Account access & appeals")}
{t("YOUR CARTOGRAPHER ACCOUNT")}

{t("Account settings.")}

·{" "} {t("Your name, your sign-in, your next expedition.")}

{active && ( )}