"use client"; import { Button } from "@/components/ui/button"; import { useClerk, useUser } from "@clerk/nextjs"; import { ExternalLink, KeyRound, Link, UserPen } from "lucide-react"; import { ResizableHandle, ResizablePanel, ResizablePanelGroup, } from "@/components/ui/resizable"; import toast from "react-hot-toast"; import { unlinkMCAccount } from "@/lib/api"; import { useEffect, useState } from "react"; import { Dialog } from "@/components/ui/dialog"; import { DialogContent, DialogTrigger } from "@/components/ui/dialog"; import CodeDialog from "@/components/misc/LinkDialog"; export default function Settings() { const clerk = useClerk(); const { user, isSignedIn } = useUser(); const [linked, setLinked] = useState(false); useEffect(() => { setLinked(user?.publicMetadata.player != undefined); }, [user, isSignedIn]); return (
Linking

Link Account

Link a Minecraft account to customize a server you own.
{" "} {user?.publicMetadata.player != undefined && linked && ( <> Currently linked to {user?.publicMetadata.player as string} )}

{!linked && ( )} { setLinked(c); }} /> {linked && ( )}

Unlink Account

Unlink your Minecraft acconut if you have already linked one.

{!linked && ( )} {linked && ( )}
All of your customizations stay the same, and can be changed if{" "} another account links your Minecraft account.
); }