import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Box, Text } from "ink";
import { SelectList } from "../design/SelectList.js";
export function treeSelectOptions(nodes) {
    return nodes.map((node) => ({
        id: node.id,
        label: `${"  ".repeat(Math.max(0, node.depth ?? 0))}${node.label}`,
        detail: node.disabled ? "disabled" : "",
        selected: node.selected,
        disabled: node.disabled,
        tone: node.selected ? "success" : "default",
    }));
}
export function TreeSelect(props) {
    return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: "cyan", children: "Select" }), _jsx(SelectList, { options: treeSelectOptions(props.nodes), width: props.width })] }));
}
