import { Code, Columns2, History, MessageSquare, Plus, RotateCcw, Swords, Terminal, Workflow, X } from 'lucide-react'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu'; import { cn } from '@/lib/utils'; // Shared pane-header action cluster: + (new) / Split / Reopen-closed-pane / // Session history / Close. Rendered in the chat tab bar (ChatTabBar) and the // desktop coder + terminal pane headers (Workspace) so all pane kinds share one // control set. Extracted to avoid a divergent copy per header. interface Props { // Mixed tabs: the "+" menu adds a tab of the chosen kind to THIS pane. Split // (the second control) adds a new pane. onNewTab: (kind: 'chat' | 'terminal' | 'coder') => void; onSplitPane: (kind: 'chat' | 'terminal' | 'coder') => void; // When provided, shows a "New Orchestrator" item that opens the flow launcher. // Orchestrators are always split (run-bound; can't live as a tab in another pane). onNewOrchestrator?: () => void; // When provided, shows a "New Arena" item that opens the arena launcher. onNewArena?: () => void; onReopenPane?: () => void; onShowHistory: () => void; onRemovePane?: () => void; // Highlights the History button when the pane is showing the landing page. historyActive?: boolean; // Positioning/spacing supplied by the parent (e.g. "ml-auto px-1"). className?: string; } const BTN = 'inline-flex items-center justify-center p-1 rounded text-muted-foreground hover:bg-muted hover:text-foreground max-md:min-h-[44px] max-md:min-w-[44px]'; export function PaneHeaderActions({ onNewTab, onSplitPane, onNewOrchestrator, onNewArena, onReopenPane, onShowHistory, onRemovePane, historyActive, className, }: Props) { return (
{/* Mixed tabs: every item adds a tab of that kind to THIS pane. */} onNewTab('chat')}> New BooChat onNewTab('terminal')}> New BooTerm onNewTab('coder')}> New BooCode {onNewOrchestrator && ( New Orchestrator )} {onNewArena && ( New Arena )} onSplitPane('chat')}> New BooChat onSplitPane('terminal')}> New BooTerm onSplitPane('coder')}> New BooCode {onNewOrchestrator && ( New Orchestrator )} {onNewArena && ( New Arena )} {onReopenPane && ( )} {onRemovePane && ( )}
); }