Some checks failed
Deploy MineGeo to Dokploy / deploy (push) Failing after 11m31s
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import { getI18n } from "@/lib/i18n";
|
|
import { Header, Footer } from "@/components/Shell";
|
|
import { Pairing } from "@/components/Pairing";
|
|
import { SignIn } from "@/components/SignIn";
|
|
import { user } from "@/lib/supabase";
|
|
export default async function Pair({
|
|
searchParams,
|
|
}: {
|
|
searchParams: Promise<{ code?: string }>;
|
|
}) {
|
|
const { t } = await getI18n();
|
|
const { code } = await searchParams;
|
|
const account = await user();
|
|
return (
|
|
<>
|
|
<Header />
|
|
<main className="section page-content" id="main-content" tabIndex={-1}>
|
|
{!account ? (
|
|
<>
|
|
<p className="muted">
|
|
{t("Sign in first, then reopen the pairing link from Minecraft.")}
|
|
</p>
|
|
<SignIn
|
|
next={
|
|
code && /^[A-F0-9]{8}$/.test(code)
|
|
? `/pair?code=${code}`
|
|
: "/dashboard"
|
|
}
|
|
/>
|
|
</>
|
|
) : code && /^[A-F0-9]{8}$/.test(code) ? (
|
|
<Pairing code={code} />
|
|
) : (
|
|
<p>{t("Open the pairing link shown by your Fabric mod.")}</p>
|
|
)}
|
|
</main>
|
|
<Footer />
|
|
</>
|
|
);
|
|
}
|