"use client"; import Link from "next/link"; 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 */}
{/* Main column — full width */}
{/* Tab bar — sits at the top, no header above it */}
{TABS.map(t => ( { if (activeTab !== t.id) (e.currentTarget as HTMLElement).style.color = "#6b6560"; }} onMouseLeave={e => { if (activeTab !== t.id) (e.currentTarget as HTMLElement).style.color = "#a09a90"; }} > {t.label} ))}
{/* Page content — full width, each page manages its own layout */}
{children}
); }