import { Component, Input } from '@angular/core';
import { INbpButton, NbpBaseComponent, NbpStyle } from '@isp/xdce-widget';

@Component({
    selector: 'nbp-fid-button-bar',
    templateUrl: './nbp-fid-button-bar.component.html',
    styleUrls: ['./nbp-fid-button-bar.component.scss']
})
export class NbpFidButtonBarComponent extends NbpBaseComponent {
    constructor(){
        super()
    }

    private _nbpStyle:  NbpStyle = NbpStyle.DEFAULT;
    @Input()
    set nbpStyle(value:  NbpStyle) {
        this._nbpStyle = value;
    }
    get nbpStyle():  NbpStyle {
        return this._nbpStyle;
    }


    private _nbpButtons: Array<INbpButton> = undefined;
    @Input()
    set nbpButtons(value: Array<INbpButton>) {
        this._nbpButtons = value.map((btn: INbpButton) =>  ({...btn, style: this._nbpStyle}));
    }
    get nbpButtons(): Array<INbpButton> {
        return this._nbpButtons;
    }
}