import { Fragment } from "react"; import { ResizableHandle, ResizablePanel, ResizablePanelGroup, } from "@/components/ui/resizable"; import type { SearchAddon } from "@xterm/addon-search"; import { TerminalPane, type TerminalPaneHandle } from "./TerminalPane"; import type { PaneNode } from "./lib/panes"; type LeafBundle = { setRef: (h: TerminalPaneHandle | null) => void; onSearch: (addon: SearchAddon) => void; onCwd: (cwd: string) => void; onExit: (code: number) => void; }; type Props = { node: PaneNode; tabVisible: boolean; activeLeafId: number; onFocusLeaf: (leafId: number) => void; getBundle: (leafId: number) => LeafBundle; }; export function PaneTreeView({ node, tabVisible, activeLeafId, onFocusLeaf, getBundle, }: Props) { if (node.kind === "leaf") { const focused = node.id === activeLeafId; const b = getBundle(node.id); return (