import { reset } from '../../dom.js';
import { getDefaultHoverDelegate } from '../hover/hoverDelegateFactory.js';
import { setupCustomHover } from '../hover/updatableHoverWidget.js';
import { renderLabelWithIcons } from './iconLabels.js';
class SimpleIconLabel {
    constructor(_container) {
        this._container = _container;
    }
    set text(text) {
        reset(this._container, ...renderLabelWithIcons(text ?? ''));
    }
    set title(title) {
        if (!this.hover && title) {
            this.hover = setupCustomHover(getDefaultHoverDelegate('mouse'), this._container, title);
        }
        else if (this.hover) {
            this.hover.update(title);
        }
    }
    dispose() {
        this.hover?.dispose();
    }
}
export { SimpleIconLabel };
