24 lines
759 B
TypeScript
24 lines
759 B
TypeScript
import { redirect } from "next/navigation";
|
|
import { connection } from "next/server";
|
|
|
|
import { AdminHeader } from "@/components/admin/admin-header";
|
|
import { ImageGeneratorNav } from "@/components/admin/image-generator-nav";
|
|
import { getAdminSession } from "@/lib/auth/server";
|
|
|
|
export default async function ImageGeneratorLayout({
|
|
children,
|
|
}: LayoutProps<"/admin/image">) {
|
|
await connection();
|
|
if (!(await getAdminSession())) redirect("/auth/login?next=%2Fadmin");
|
|
|
|
return (
|
|
<div className="min-h-svh">
|
|
<AdminHeader />
|
|
<main className="mx-auto flex w-full max-w-384 flex-col gap-6 p-4 sm:p-6 lg:flex-row lg:p-8">
|
|
<ImageGeneratorNav />
|
|
<div className="min-w-0 flex-1">{children}</div>
|
|
</main>
|
|
</div>
|
|
);
|
|
}
|