brawlset/app/app/layout.tsx

53 lines
1.5 KiB
TypeScript

import type { Metadata } from "next";
import localFont from "next/font/local";
import "./globals.css";
import { cookies } from 'next/headers'
import { NavigationBar } from "@/components/ui/navigation-bar"
import { decryptToken } from '@/lib/jwt'
const geistSans = localFont({
src: "./fonts/GeistVF.woff",
variable: "--font-geist-sans",
weight: "100 900",
});
const geistMono = localFont({
src: "./fonts/GeistMonoVF.woff",
variable: "--font-geist-mono",
weight: "100 900",
});
export const metadata: Metadata = {
title: "Brawl Set",
description: "Un mode de jeu MTG 100% rennais",
};
export default async function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const cookieStore = await cookies()
const JWT = cookieStore.get("JWT")
let username = ""
if(JWT !== undefined){
username = decryptToken(JWT.value)?.username
}
return (
<html lang="fr">
<body
className={`${geistSans.variable} ${geistMono.variable} antialiased font-inter-tight`}
>
<NavigationBar username={username} isLoggedIn={JWT !== undefined} />
<div className="min-h-screen scroll-smooth">
{children}
</div>
<div className="flex flex-col p-4 items-center text-sm">
<h1>Brawlset is unofficial Fan Content permitted under the Fan Content Policy. Not approved/endorsed by Wizards. Portions of the materials used are property of Wizards of the Coast. ©Wizards of the Coast LLC.</h1>
</div>
</body>
</html>
);
}