/* eslint-disable class-methods-use-this */
import React from 'react';
export default class DyteControlBar {
    constructor() {
        this.buttons = [];
    }
    addButton(button) {
        const newButton = button;
        if (typeof button.icon === 'string') {
            // eslint-disable-next-line react/no-danger
            newButton.icon = <div dangerouslySetInnerHTML={{ __html: button.icon }}/>;
        }
        this.buttons.push(newButton);
        if (this._setButtons) {
            this._setButtons([...this.buttons]);
        }
        return this.buttons.length - 1;
    }
    removeButton(button) {
        this.buttons[button] = {};
        this._setButtons([...this.buttons]);
    }
}
//# sourceMappingURL=DyteControlBar.js.map