The first commit, the core and all files is adding to repo
This commit is contained in:
32
app/pair/page.tsx
Normal file
32
app/pair/page.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
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 { code } = await searchParams;
|
||||
const account = await user();
|
||||
return (
|
||||
<>
|
||||
<Header />
|
||||
<main className="section page-content">
|
||||
{!account ? (
|
||||
<>
|
||||
<p className="muted">
|
||||
Sign in first, then reopen the pairing link from Minecraft.
|
||||
</p>
|
||||
<SignIn />
|
||||
</>
|
||||
) : code && /^[A-F0-9]{8}$/.test(code) ? (
|
||||
<Pairing code={code} />
|
||||
) : (
|
||||
<p>Open the pairing link shown by your Fabric mod.</p>
|
||||
)}
|
||||
</main>
|
||||
<Footer />
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user