"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImageSkeletonDescriptor = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const uikit_1 = require("@gravity-ui/uikit");
const classname_1 = require("../../../../classname.js");
const WidgetDecoration_1 = require("../../../behavior/WidgetDecoration/index.js");
require("./skeleton.css");
const b = (0, classname_1.cn)('image-skeleton');
class ImageSkeletonDescriptor extends WidgetDecoration_1.ReactWidgetDescriptor {
    #domElem;
    get pos() {
        return this.getPos?.() ?? this.initPos;
    }
    constructor(initPos, size) {
        super(initPos, 'image_skeleton');
        this.#domElem = document.createElement('span');
        this.#domElem.classList.add(b());
        if (size) {
            this.#domElem.style.setProperty('--img-skeleton-width', size.width);
            this.#domElem.style.setProperty('--img-skeleton-height', size.height);
        }
    }
    getDomElem() {
        return this.#domElem;
    }
    renderReactElement() {
        return (0, jsx_runtime_1.jsx)(uikit_1.Skeleton, { className: b('skeleton') });
    }
}
exports.ImageSkeletonDescriptor = ImageSkeletonDescriptor;
//# sourceMappingURL=skeleton.js.map
