"use client"; import { usePathname } from "next/navigation"; import { ReactNode } from "react"; import Link from "next/link"; import { signOut, useSession } from "next-auth/react"; import { CooChat } from "./coo-chat"; 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 TOP_NAV = [ { id: "build", label: "Build", path: "build" }, { id: "market", label: "Market", path: "growth" }, { id: "assist", label: "Assist", path: "assist" }, ] as const; export function ProjectShell({ children, workspace, projectId, projectName, }: ProjectShellProps) { const pathname = usePathname(); const { data: session } = useSession(); const activeSection = pathname?.includes("/build") ? "build" : pathname?.includes("/growth") ? "market" : pathname?.includes("/assist") ? "assist" : "build"; const userInitial = (session?.user?.name?.[0] ?? session?.user?.email?.[0] ?? "?").toUpperCase(); return ( <>
{/* ── Top navbar ── */}
{/* Left: logo + project name */}
VIBN
{projectName}
{/* Center: section tabs */}
{TOP_NAV.map(item => { const isActive = activeSection === item.id; return ( { if (!isActive) (e.currentTarget as HTMLElement).style.background = "#f6f4f0"; }} onMouseLeave={e => { if (!isActive) (e.currentTarget as HTMLElement).style.background = "transparent"; }} > {item.label} ); })}
{/* Right: user avatar */}
{/* ── Main area ── */}
{/* Left: COO / Assist — persistent across all sections */}
{/* Chat header */}
Assist
Your product COO
{/* Right: page content — changes with top nav */}
{children}
); }