"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChangeItemLabel = void 0;
var react_1 = __importDefault(require("react"));
var classnames_1 = __importDefault(require("classnames"));
var useCssVariableStyles_1 = require("../../../../../hooks/useCssVariableStyles");
var RequiredMark_1 = require("../../../../../RequiredMark");
var ChangeItemLabel_module_css_1 = __importDefault(require("./ChangeItemLabel.module.css"));
var ChangeItemLabel = function (_a) {
    var _b;
    var change = _a.change, className = _a.className, _c = _a.showLabel, showLabel = _c === void 0 ? true : _c;
    var _d = change.level, level = _d === void 0 ? 0 : _d, label = change.label;
    var isRequired = (_b = change === null || change === void 0 ? void 0 : change.attributeType) === null || _b === void 0 ? void 0 : _b.required;
    var variableStyles = (0, useCssVariableStyles_1.useCssVariableStyles)({
        '--level': level
    });
    return (react_1.default.createElement("div", { className: (0, classnames_1.default)(ChangeItemLabel_module_css_1.default.changeLabel, className), style: variableStyles }, showLabel && (react_1.default.createElement(react_1.default.Fragment, null,
        label,
        isRequired && react_1.default.createElement(RequiredMark_1.RequiredMark, null)))));
};
exports.ChangeItemLabel = ChangeItemLabel;
