+
+ {/* Panel nav content */}
+
- ) : (
-
- )}
-
- {/* Bottom — utility items */}
-
- {/* Notifications, Profile — same layout as nav items */}
-
-
-
-
-
- {c && (
-
- Notifications
-
- )}
-
-
- router.push('/onboarding')}
- allowPersonalOrganization={false}
- onOpenSettings={openSettings}
- onOpenOrgSettings={openOrgSettings}
- compact
- anchor="right"
- >
-
-
- {c && (
-
- {user?.display_name?.trim() || 'Profile'}
-
- )}
-
-
)
}
-// ─── Main Sidebar ───────────────────────────────────────────
+// ─── Main Sidebar ──────────────────────────────────────────
export default function Sidebar({
siteId, mobileOpen, onMobileClose, onMobileOpen,
@@ -435,37 +384,38 @@ export default function Sidebar({
const handleMobileClose = useCallback(() => {
setMobileClosing(true)
- setTimeout(() => {
- setMobileClosing(false)
- onMobileClose()
- }, 200)
+ setTimeout(() => { setMobileClosing(false); onMobileClose() }, 200)
}, [onMobileClose])
const handleNavigate = useCallback((href: string) => { setPendingHref(href) }, [])
+ const railProps = {
+ sites,
+ currentSiteId: siteId,
+ auth,
+ orgs,
+ onSwitchOrganization: handleSwitchOrganization,
+ openSettings: () => openUnifiedSettings({ context: 'account', tab: 'profile' }),
+ openOrgSettings: () => openUnifiedSettings({ context: 'workspace', tab: 'general' }),
+ }
+
+ const panelProps = {
+ siteId,
+ sites,
+ canEdit,
+ pendingHref,
+ onNavigate: handleNavigate,
+ }
+
return (
<>
- {/* Desktop — ssr:false means this only renders on client, no hydration flash */}
+ {/* Desktop */}
{/* Mobile overlay */}
@@ -478,11 +428,12 @@ export default function Sidebar({
onClick={handleMobileClose}
/>
>
)}