'use client'; import React from 'react'; import Link from 'next/link'; import { usePathname } from 'next/navigation'; import { LayoutDashboard, Workflow, Palette, FlaskConical, Rocket, Store, type LucideIcon, } from 'lucide-react'; interface NavItem { icon: LucideIcon; label: string; href: string; segment: string; } const NAV_ITEMS: NavItem[] = [ { icon: LayoutDashboard, label: 'Dashboard', href: '/', segment: '' }, { icon: Workflow, label: 'Editor', href: '/editor', segment: 'editor' }, { icon: Palette, label: 'Apps', href: '/apps', segment: 'apps' }, { icon: FlaskConical, label: 'Tests', href: '/tests', segment: 'tests' }, { icon: Rocket, label: 'Deploy', href: '/deploy', segment: 'deploy' }, { icon: Store, label: 'Marketplace', href: '/marketplace', segment: 'marketplace' }, ]; function NavRail() { const pathname = usePathname(); // Extract project id from path: /(dashboard)/projects/[id]/... const segments = pathname.split('/'); const projectIdIndex = segments.indexOf('projects') + 1; const projectId = segments[projectIdIndex] ?? ''; const currentSegment = segments[projectIdIndex + 1] ?? ''; return ( ); } interface DashboardLayoutProps { children: React.ReactNode; } export default function DashboardLayout({ children }: DashboardLayoutProps) { return (