"use client"; import { usePathname } from "next/navigation"; import { ReactNode, Suspense } from "react"; import Link from "next/link"; import { signOut, useSession } from "next-auth/react"; 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 SECTIONS = [ { id: "overview", label: "Vibn", 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" }, ] as const; function ProjectShellInner({ children, workspace, projectId, projectName, }: ProjectShellProps) { const pathname = usePathname(); const { data: session } = useSession(); const activeSection = pathname?.includes("/overview") ? "overview" : pathname?.includes("/prd") ? "prd" : pathname?.includes("/build") ? "build" : pathname?.includes("/growth") ? "growth" : pathname?.includes("/assist") ? "assist" : pathname?.includes("/analytics") ? "analytics" : "overview"; const userInitial = ( session?.user?.name?.[0] ?? session?.user?.email?.[0] ?? "?" ).toUpperCase(); return ( <>
{/* ── Top bar ── */}
{/* Logo + project name */}
VIBN
{projectName}
{/* Tab nav */}
{SECTIONS.map(s => { const isActive = activeSection === s.id; return ( { if (!isActive) (e.currentTarget as HTMLElement).style.background = "var(--muted)"; }} onMouseLeave={e => { if (!isActive) (e.currentTarget as HTMLElement).style.background = "transparent"; }} > {s.label} ); })} {/* Spacer */}
{/* User avatar */}
{/* ── Full-width content ── */}
{children}
); } // Wrap in Suspense because useSearchParams requires it export function ProjectShell(props: ProjectShellProps) { return ( ); }