47 lines
1.2 KiB
TypeScript
47 lines
1.2 KiB
TypeScript
import type { Metadata } from "next";
|
|
import { Geist, Geist_Mono, Inter } from "next/font/google";
|
|
import TopBar from "./components/TopBar";
|
|
import "./globals.css";
|
|
import { cn } from "@/lib/utils";
|
|
import { getServerSession } from "next-auth";
|
|
import { authOptions } from "@/lib/auth";
|
|
|
|
const inter = Inter({subsets:['latin'],variable:'--font-sans'});
|
|
|
|
const geistSans = Geist({
|
|
variable: "--font-geist-sans",
|
|
subsets: ["latin"],
|
|
});
|
|
|
|
const geistMono = Geist_Mono({
|
|
variable: "--font-geist-mono",
|
|
subsets: ["latin"],
|
|
});
|
|
|
|
export const metadata: Metadata = {
|
|
title: "Create Next App",
|
|
description: "Generated by create next app",
|
|
};
|
|
|
|
export default async function RootLayout({
|
|
children,
|
|
}: Readonly<{
|
|
children: React.ReactNode;
|
|
}>) {
|
|
const session = await getServerSession(authOptions);
|
|
const isLoggedIn = !!session;
|
|
|
|
return (
|
|
<html
|
|
lang="en"
|
|
suppressHydrationWarning
|
|
className={cn("h-full", "antialiased", geistSans.variable, geistMono.variable, "font-sans", inter.variable)}
|
|
>
|
|
<body className="min-h-full flex flex-col bg-background text-foreground transition-colors">
|
|
<TopBar isLoggedIn={isLoggedIn} />
|
|
<main className="flex flex-1 flex-col">{children}</main>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|