// — draws a split tree (`agent/terminal/split-layout.ts`): panes // in rows and columns that fill their box, with a divider between neighbours // that is dragged with the pointer or moved with the arrow keys. It owns the // geometry only; what a pane shows is the caller's (`renderPane`). import { useRef } from "preact/hooks"; import { Fragment, type ComponentChildren } from "preact"; import type { Node } from "../../agent/terminal/split-layout.js"; import "./PaneTree.css"; function Divider({ dir, onMove, }: { dir: "row" | "column"; /** Pixels moved along the split's axis since the last event. */ onMove: (px: number) => void; }) { const last = useRef(null); const along = (e: PointerEvent) => (dir === "row" ? e.clientX : e.clientY); return (