"use client"; import { usePathname } from "next/navigation"; import { ReactNode } from "react"; import { VIBNSidebar } from "./vibn-sidebar"; import { Toaster } from "sonner"; interface ProjectShellProps { children: ReactNode; workspace: string; projectId: string; projectName: string; projectDescription?: string; projectStatus?: string; projectProgress?: number; discoveryPhase?: number; capturedData?: Record; createdAt?: string; updatedAt?: string; featureCount?: number; creationMode?: "fresh" | "chat-import" | "code-import" | "migration"; } const ALL_TABS = [ { id: "overview", label: "Atlas", path: "overview" }, { id: "prd", label: "PRD", path: "prd" }, { id: "build", label: "Build", path: "build" }, { id: "growth", label: "Growth", path: "growth" }, { id: "assist", label: "Assist", path: "assist" }, { id: "analytics", label: "Analytics", path: "analytics" }, ]; function getTabsForMode( mode: "fresh" | "chat-import" | "code-import" | "migration" = "fresh" ) { switch (mode) { case "code-import": return ALL_TABS.filter(t => t.id !== "prd"); case "migration": return ALL_TABS .filter(t => t.id !== "prd") .map(t => t.id === "overview" ? { ...t, label: "Migration Plan" } : t); default: return ALL_TABS; } } export function ProjectShell({ children, workspace, projectId, creationMode, }: ProjectShellProps) { const pathname = usePathname(); const TABS = getTabsForMode(creationMode); const activeTab = TABS.find(t => pathname?.includes(`/${t.path}`))?.id ?? "overview"; return ( <>
{/* Left sidebar — includes project tabs */}
{/* Page content — extends to the very top */}
{children}
); }