diff --git a/apps/studio/components/layouts/NavigationV2/DefaultLayoutV2.tsx b/apps/studio/components/layouts/NavigationV2/DefaultLayoutV2.tsx index d0896ecd4a7..447c4184104 100644 --- a/apps/studio/components/layouts/NavigationV2/DefaultLayoutV2.tsx +++ b/apps/studio/components/layouts/NavigationV2/DefaultLayoutV2.tsx @@ -6,6 +6,7 @@ import { AppBannerWrapper } from 'components/interfaces/App/AppBannerWrapper' import { SidebarInset, SidebarProvider } from 'ui' import { AppSidebarV2 } from './AppSidebarV2' import { RightRailLayout } from './RightIconRail' +import { LayoutSidebarProvider } from '../ProjectLayout/LayoutSidebar/LayoutSidebarProvider' import { ProjectContextProvider } from '../ProjectLayout/ProjectContext' export interface DefaultLayoutV2Props { @@ -30,17 +31,19 @@ export const DefaultLayoutV2 = ({ children }: PropsWithChildren -
- - - - {!router.pathname.startsWith('/account') && } - -
{children}
-
-
-
-
+ +
+ + + + {!router.pathname.startsWith('/account') && } + +
{children}
+
+
+
+
+
) } diff --git a/apps/studio/components/layouts/NavigationV2/RightIconRail.tsx b/apps/studio/components/layouts/NavigationV2/RightIconRail.tsx index ea3e87da55e..7ffa0a69293 100644 --- a/apps/studio/components/layouts/NavigationV2/RightIconRail.tsx +++ b/apps/studio/components/layouts/NavigationV2/RightIconRail.tsx @@ -1,40 +1,38 @@ -import { Bell, Bot, CircleHelp, Database, type LucideIcon } from 'lucide-react' -import { useMemo, useState, type ReactNode } from 'react' +import { Bot, Lightbulb, PenLine, type LucideIcon } from 'lucide-react' +import type { ReactNode } from 'react' +import { useSidebarManagerSnapshot } from 'state/sidebar-manager-state' +import { SIDEBAR_KEYS } from '../ProjectLayout/LayoutSidebar/LayoutSidebarProvider' import { cn } from 'ui' -type RailItem = { +interface RailItem { + id: string label: string icon: LucideIcon } -const rightRailItems: RailItem[] = [ - { label: 'AI', icon: Bot }, - { label: 'SQL', icon: Database }, - { label: 'Alerts', icon: Bell }, - { label: 'Help', icon: CircleHelp }, +const RAIL_ITEMS: RailItem[] = [ + { id: SIDEBAR_KEYS.AI_ASSISTANT, label: 'AI', icon: Bot }, + { id: SIDEBAR_KEYS.EDITOR_PANEL, label: 'Editor', icon: PenLine }, + { id: SIDEBAR_KEYS.ADVISOR_PANEL, label: 'Advisor', icon: Lightbulb }, ] -export function RightIconRail({ - activeItemLabel, - onSelect, -}: { - activeItemLabel: string | null - onSelect: (label: string) => void -}) { +function RightIconRail() { + const { activeSidebar, toggleSidebar } = useSidebarManagerSnapshot() + return ( -