+
{children}
@@ -23,11 +20,3 @@ function Shell({ companyName, userEmail, openAlerts, children }: DashboardShellP
)
}
-
-export function DashboardShell(props: DashboardShellProps) {
- return (
-
-
-
- )
-}
diff --git a/src/components/layout/Sidebar.tsx b/src/components/layout/Sidebar.tsx
index a532684..0d2d36b 100644
--- a/src/components/layout/Sidebar.tsx
+++ b/src/components/layout/Sidebar.tsx
@@ -1,14 +1,10 @@
"use client"
+import type { ReactNode } from "react"
import Link from "next/link"
import { usePathname } from "next/navigation"
import { signOut } from "next-auth/react"
-import { useEffect, useRef } from "react"
import { cn } from "@/lib/utils"
-import { useSidebar } from "./SidebarContext"
-
-// Auto-close the floating sidebar after this idle delay (no pointer over it).
-const AUTO_CLOSE_MS = 4000
import {
LayoutDashboard,
Users,
@@ -19,7 +15,7 @@ import {
KeyRound,
Send,
LogOut,
- PanelLeftClose,
+ ShieldCheck,
} from "lucide-react"
const navItems = [
@@ -33,115 +29,83 @@ const navItems = [
{ href: "/notifications", label: "Notifications", icon: Send },
]
+// Layers (within the aside stacking context): labels z-10 sit UNDER the rail
+// surface z-20, icons/pills z-30 sit ABOVE it. A label starts tucked behind the
+// surface and slides right on hover, so it emerges from under the panel.
+function RailLabel({ children }: { children: ReactNode }) {
+ return (
+
+
+ {children}
+
+
+ )
+}
+
interface SidebarProps {
- companyName: string
- userEmail: string
openAlerts: number
}
-export function Sidebar({ companyName, userEmail, openAlerts }: SidebarProps) {
+export function Sidebar({ openAlerts }: SidebarProps) {
const pathname = usePathname()
- const { open, toggle, close } = useSidebar()
- const timer = useRef
| null>(null)
- const asideRef = useRef(null)
-
- const clearTimer = () => {
- if (timer.current) clearTimeout(timer.current)
- timer.current = null
- }
- const startTimer = () => {
- clearTimer()
- timer.current = setTimeout(close, AUTO_CLOSE_MS)
- }
-
- // Start the idle countdown whenever the sidebar opens; hovering pauses it.
- useEffect(() => {
- if (open) startTimer()
- else clearTimer()
- return clearTimer
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [open])
-
- // Close when clicking anywhere outside the panel.
- useEffect(() => {
- if (!open) return
- const handler = (e: MouseEvent) => {
- if (!asideRef.current?.contains(e.target as Node)) close()
- }
- document.addEventListener("mousedown", handler)
- return () => document.removeEventListener("mousedown", handler)
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [open])
return (
-