This commit is contained in:
NotII
2025-03-09 03:33:58 +00:00
parent 20807da752
commit b45a4e2e01
4 changed files with 132 additions and 16 deletions

View File

@@ -2,6 +2,7 @@
import { useState, useEffect } from "react"
import { useTheme } from "next-themes"
import { usePathname } from "next/navigation"
import Sidebar from "./sidebar"
import UnifiedNotifications from "@/components/notifications/UnifiedNotifications"
import type React from "react"
@@ -13,6 +14,10 @@ interface LayoutProps {
export default function Layout({ children }: LayoutProps) {
const { theme } = useTheme()
const [mounted, setMounted] = useState(false)
const pathname = usePathname()
// Check if we're in a chat detail page
const isChatDetailPage = pathname?.includes('/dashboard/chats/') && !pathname?.endsWith('/chats') && !pathname?.endsWith('/new')
useEffect(() => setMounted(true), [])
@@ -27,7 +32,9 @@ export default function Layout({ children }: LayoutProps) {
<UnifiedNotifications />
</div>
</header>
<main className="flex-1 overflow-auto p-6 dark:bg-[#0F0F12]">{children}</main>
<main className={`flex-1 overflow-auto ${isChatDetailPage ? 'p-0' : 'p-6'} dark:bg-[#0F0F12]`}>
{children}
</main>
</div>
</div>
)