"use client"; import { useSidebar } from "@/context/SidebarContext"; import AppHeader from "@/layout/AppHeader"; import AppSidebar from "@/layout/AppSidebar"; import Backdrop from "@/layout/Backdrop"; import React from "react"; import { useAuth } from "@/hooks/useAuth"; export default function AdminLayout({ children, }: { children: React.ReactNode; }) { const { isExpanded, isHovered, isMobileOpen } = useSidebar(); useAuth({ middleware: 'auth' }); // Fetch user, but strict redirect is disabled in hook // Dynamic class for main content margin based on sidebar state const mainContentMargin = isMobileOpen ? "ml-0" : isExpanded || isHovered ? "lg:ml-[290px]" : "lg:ml-[90px]"; return (