2025-03-14 16:11:51 +00:00
|
|
|
import Link from "next/link";
|
2025-03-14 06:38:51 +00:00
|
|
|
import Image from "next/image";
|
|
|
|
import { auth } from "@/lib/auth";
|
|
|
|
import { Code } from "lucide-react";
|
|
|
|
import { redirect } from "next/navigation";
|
|
|
|
|
|
|
|
interface AuthLayoutProps {
|
|
|
|
children: React.ReactNode;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default async function AuthLayout({
|
|
|
|
children
|
|
|
|
}: AuthLayoutProps) {
|
|
|
|
const session = await auth();
|
|
|
|
if (session) redirect("/");
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className="grid min-h-svh lg:grid-cols-2">
|
|
|
|
<div className="flex flex-col gap-4 p-6 md:p-10">
|
|
|
|
<div className="flex justify-center gap-2 md:justify-start">
|
2025-03-14 16:11:51 +00:00
|
|
|
<Link href="/" className="flex items-center gap-2 font-medium">
|
2025-03-14 06:38:51 +00:00
|
|
|
<div className="flex h-6 w-6 items-center justify-center rounded-md bg-primary text-primary-foreground">
|
|
|
|
<Code className="size-4" />
|
|
|
|
</div>
|
|
|
|
Judge4c
|
2025-03-14 16:11:51 +00:00
|
|
|
</Link>
|
2025-03-14 06:38:51 +00:00
|
|
|
</div>
|
|
|
|
<div className="flex flex-1 items-center justify-center">
|
|
|
|
<div className="w-full max-w-sm">{children}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="relative hidden bg-muted lg:block">
|
|
|
|
<Image
|
|
|
|
src="/placeholder.svg"
|
|
|
|
alt="Image"
|
|
|
|
fill
|
|
|
|
className="absolute inset-0 h-full w-full object-cover dark:brightness-[0.2] dark:grayscale"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|