/*********************************************************************************************************************************************************************** * File Name: AdminAppLayout.jsx * Type of Program: Layout Route * Description: A Layout designated for Admin End-User. * Module: Admin * Author: lash0000 * Date Created: November. 28, 2025 *********************************************************************************************************************************************************************** * Change History: * DATE AUTHOR LOG NUMBER DESCRIPTION * Oct. 10, 2025 lash0000 001 Initial creation - STAR Phase 1 Project ***********************************************************************************************************************************************************************/ import { Outlet, useNavigate } from "react-router-dom" import { useRef, useEffect } from "react" import { useAuth } from "@/contexts/AuthContext" import { AdminProvider } from "@/contexts/provider/AdminProvider" // ← add import { TooltipProvider } from "@/components/ui/tooltip" import { Badge } from "@/components/ui/badge" import { Toaster } from "sonner" import { cn } from "@/lib/utils" import UserMenu from "@/components/generic/UserMenu" import NotificationBell from "@/components/generic/NotificationBell" import { ROLE_CONFIG } from "@/data/profile.data" const AdminLayout = () => { const { user, logout } = useAuth(); const navigate = useNavigate(); const headerRef = useRef(null) const role = ROLE_CONFIG[user?.acc_type] ?? { label: user?.acc_type, variant: 'outline' } useEffect(() => { if (!headerRef.current) return const update = () => { document.documentElement.style.setProperty('--navbar-h', `${headerRef.current.offsetHeight}px`) } update() const ro = new ResizeObserver(update) ro.observe(headerRef.current) return () => ro.disconnect() }, []) return (
{/* AdminProvider wraps header + body so UserMenu can access ProfileProvider */}
navigate("/")}> Philproperties Philproperties
{role.label}
{/* Footer sits outside AdminProvider intentionally */}
) } export default AdminLayout