import { Link, Outlet, useLocation } from "react-router-dom"; import { ArrowLeft } from "lucide-react"; import { AppMenuTabs } from "./AppMenuTabs"; import { Sidebar, SidebarContent, SidebarHeader, SidebarInset, SidebarRail, useSidebar, } from "@/shared/common/ui/sidebar"; import Top from "@/record-management/components/common/Top"; import { useAuth } from "@/shared/context/AuthContext"; export const AppLayout = () => { const { pathname } = useLocation(); const isAuthPage = pathname === "/"; const { toggleSidebar } = useSidebar(); const { user } = useAuth(); const userRoles = user?.roles?.map((role) => role.key) || []; const isSuperAdmin = userRoles.includes("super_admin"); // Standalone full-page scroll container for the auth screen — the host // chrome is `overflow: hidden`, so this subtree must scroll itself. if (isAuthPage) { return (
); } return ( <> {/* Full-height sidebar owning the left column (back-to-home + brand at the top). lives inside , to the right of the sidebar, and is `sticky` — so it never overlaps the sidebar and re-flows when the sidebar collapses to its icon rail. Top's burger (onToggleSidebar) drives collapse on desktop and the Sheet drawer on mobile. */} Back to home EDR
User Management EDR Freight
{/* Internal scroll container: the sidebar stays fixed and full-height while this column scrolls beneath the sticky bar. */}
); };