"use client"; import { useState } from "react"; import { motion, AnimatePresence } from "framer-motion"; import { usePathname } from "next/navigation"; import { Sidebar } from "./Sidebar"; import { Navbar } from "./Navbar"; import { Menu } from "lucide-react"; import { useThemeStore } from "@/lib/stores/themeStore"; // ─── Page transition wrapper ────────────────────────────────────────────────── function PageTransition({ children }: { children: React.ReactNode }) { const pathname = usePathname(); return ( {children} ); } export function DashboardLayout({ children }: { children: React.ReactNode }) { const [mobileOpen, setMobileOpen] = useState(false); const { theme } = useThemeStore(); const isLight = theme === "light"; return (
{/* Ambient background gradients */}
{/* Noise texture — only visible in dark mode */} {!isLight && (
)}
{/* ── Desktop Sidebar ─────────────────────────────────────────────────── */}
{/* ── Mobile Sidebar Overlay ───────────────────────────────────────────── */} {mobileOpen && ( <> setMobileOpen(false)} className={`fixed inset-0 z-30 backdrop-blur-sm lg:hidden ${isLight ? "bg-slate-900/30" : "bg-black/60"}`} /> )} {/* ── Main content ─────────────────────────────────────────────────────── */}
{/* Mobile header with hamburger */}
BankBot
{children}
); }