import React from 'react';
import classnames from 'classnames';
import { DEPTH_LEVEL_INDENT } from './helper';
import styles from './RCTREELevelLines.module.css';
var LevelLine = function (_a) {
    var _b;
    var _c = _a.needDrawLine, needDrawLine = _c === void 0 ? false : _c, _d = _a.isLastLevelLine, isLastLevelLine = _d === void 0 ? false : _d, _e = _a.drawHorizontalLine, drawHorizontalLine = _e === void 0 ? false : _e;
    return (React.createElement("div", { className: classnames(styles.levelLine, (_b = {},
            _b[styles.showLine] = needDrawLine,
            _b[styles.lastLevelLine] = isLastLevelLine,
            _b[styles.horizontalLine] = drawHorizontalLine,
            _b)) }));
};
export var RCTreeLevelLines = function (_a) {
    var levelLine = _a.levelLine;
    var _b = levelLine || [], _c = _b[0], needDrawLines = _c === void 0 ? [] : _c, _d = _b[1], isLast = _d === void 0 ? false : _d;
    var level = needDrawLines.length + 2;
    return (React.createElement("div", { className: styles.levelLines, style: { left: "-".concat(DEPTH_LEVEL_INDENT * level, "px") } }, needDrawLines
        .map(function (needDrawLine, index) {
        return React.createElement(LevelLine, { key: index, needDrawLine: needDrawLine });
    })
        .concat(React.createElement(LevelLine, { key: level, needDrawLine: true, drawHorizontalLine: true, isLastLevelLine: isLast }))));
};
