diff --git a/app/layout.tsx b/app/layout.tsx index e28ade7..18bcc19 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,5 +1,4 @@ import type { Metadata } from "next"; -import { headers } from "next/headers"; import "@/app/globals.css"; import { AppShell } from "@/components/app-shell"; @@ -14,9 +13,6 @@ export default async function RootLayout({ }: Readonly<{ children: React.ReactNode; }>) { - const headerList = await headers(); - const pathname = headerList.get("x-pathname") || "/tasks"; - return ( @@ -28,7 +24,7 @@ export default async function RootLayout({ /> - {children} + {children} ); diff --git a/components/app-shell.tsx b/components/app-shell.tsx index e35fa88..2464a35 100644 --- a/components/app-shell.tsx +++ b/components/app-shell.tsx @@ -1,4 +1,7 @@ +"use client"; + import Link from "next/link"; +import { usePathname } from "next/navigation"; import { Network, NotebookTabs, PanelsTopLeft, ScrollText, Send, Settings2, ShieldEllipsis, UsersRound } from "lucide-react"; import { cn } from "@/lib/utils"; @@ -16,12 +19,12 @@ const navItems = [ ]; export function AppShell({ - pathname, children, }: { - pathname: string; children: React.ReactNode; }) { + const pathname = usePathname(); + return (
@@ -44,7 +47,8 @@ export function AppShell({