"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"; import { Globe, Cloud, Palette, Code2, BarChart2, MoreHorizontal } from "lucide-react"; 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"; } // Width of the left chat panel — must match in both the header and the body const CHAT_W = 320; const SECTIONS = [ { id: "build", label: "Build", path: "build" }, { id: "market", label: "Market", path: "growth" }, { id: "assist", label: "Assist", path: "assist" }, ] as const; // Tool icons shown to the right of section pills const TOOLS = [ { id: "preview", Icon: Globe, label: "Preview", title: "Open preview" }, { id: "backend", Icon: Cloud, label: "Backend", title: "Backend / Infra" }, { id: "design", Icon: Palette, label: "Design", title: "Design" }, { id: "code", Icon: Code2, label: "Code", title: "Code" }, { id: "analytics",Icon: BarChart2, label: "Analytics", title: "Analytics" }, { id: "more", Icon: MoreHorizontal, label: "More", title: "More options" }, ]; 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 bar — split to align with panels below ── */}
{/* Left section — aligns with chat panel */}
VIBN
{projectName}
{/* Right section — aligns with content panel */}
{/* Section pills: Build | Market | Assist */}
{SECTIONS.map(s => { const isActive = activeSection === s.id; return ( { if (!isActive) (e.currentTarget as HTMLElement).style.background = "#f6f4f0"; }} onMouseLeave={e => { if (!isActive) (e.currentTarget as HTMLElement).style.background = "transparent"; }} > {s.label} ); })}
{/* Divider */}
{/* Tool icons */}
{TOOLS.map(({ id, Icon, title }) => ( ))}
{/* User avatar */}
{/* ── Main area ── */}
{/* Left: Assist chat — persistent */}
{/* Chat header */}
Assist
Your product COO
{/* Right: content — changes per section */}
{children}
); }