"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.RCTreeLevelLines = void 0;
var react_1 = __importDefault(require("react"));
var classnames_1 = __importDefault(require("classnames"));
var helper_1 = require("./helper");
var RCTREELevelLines_module_css_1 = __importDefault(require("./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_1.default.createElement("div", { className: (0, classnames_1.default)(RCTREELevelLines_module_css_1.default.levelLine, (_b = {},
            _b[RCTREELevelLines_module_css_1.default.showLine] = needDrawLine,
            _b[RCTREELevelLines_module_css_1.default.lastLevelLine] = isLastLevelLine,
            _b[RCTREELevelLines_module_css_1.default.horizontalLine] = drawHorizontalLine,
            _b)) }));
};
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_1.default.createElement("div", { className: RCTREELevelLines_module_css_1.default.levelLines, style: { left: "-".concat(helper_1.DEPTH_LEVEL_INDENT * level, "px") } }, needDrawLines
        .map(function (needDrawLine, index) {
        return react_1.default.createElement(LevelLine, { key: index, needDrawLine: needDrawLine });
    })
        .concat(react_1.default.createElement(LevelLine, { key: level, needDrawLine: true, drawHorizontalLine: true, isLastLevelLine: isLast }))));
};
exports.RCTreeLevelLines = RCTreeLevelLines;
