From b006ac7f008aedcedf0623fa6f7a9bc6610d6834 Mon Sep 17 00:00:00 2001 From: AV77web Date: Wed, 27 May 2026 16:10:53 +0200 Subject: [PATCH] inerito SignOuitButton --- src/app/layout.tsx | 8 ++++++-- src/components/Navbar.tsx | 14 ++++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index ef60dbf..c6b3f1d 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,5 +1,7 @@ import type { Metadata } from "next"; import { Inter, JetBrains_Mono } from "next/font/google"; +import { auth } from "@/src/auth"; +import SignOutButton from "@/src/components/auth/SignOutButton"; import Navbar from "../components/Navbar"; import "./globals.css"; @@ -19,18 +21,20 @@ export const metadata: Metadata = { description: "Generated by create next app", }; -export default function RootLayout({ +export default async function RootLayout({ children, }: Readonly<{ children: React.ReactNode; }>) { + const session = await auth(); + return (

Sono del layout root

- + : null} /> {children} diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index b649d24..789adfb 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -5,7 +5,7 @@ // @version: "1.0.0 2026-05-07" //==================================== "use client" -import { useState , MouseEvent} from "react"; +import { useState , MouseEvent, ReactNode} from "react"; import Link from "next/link"; interface NavLink { @@ -34,7 +34,7 @@ const serviceLinks: ServiceLink[] = [ ] -export default function Navbar() { +export default function Navbar({ actions }: { actions?: ReactNode }) { const [ isServicesOpen, setIsServicesOpen] = useState(false); @@ -56,7 +56,7 @@ export default function Navbar() { {/* Navigation */} -
+
{/* Link normali */} {navLinks.map((link) => ( @@ -117,8 +117,14 @@ export default function Navbar() {
+ + {actions ? ( +
+ {actions} +
+ ) : null} ); -} \ No newline at end of file +}