import { Component, EventEmitter, Input, Output } from '@angular/core';
import { CongEventFunctionAllMaxOutput, CongEventCandidateOutput, CongEventFunctionOutput } from '~/pages/event/entities/cong-event-detail.types';

@Component({
    selector: 'CongEventVoteDetail',
    moduleId: module.id,
    templateUrl: './cong-event-vote-detail.component.html',
})
export class CongEventVoteDetailComponent {

    @Input()
    isLoading: boolean = true;

    @Input()
    functionsMax: CongEventFunctionAllMaxOutput[];
    @Input()
    candidates: CongEventCandidateOutput[];
    @Input()
    functions: CongEventFunctionOutput[];

    _groupedFns: {}
    get groupedFns() {
        return this._groupedFns;
    }
    groupedKeysArr = []
    @Input()
    set groupedFns(val) {
        if (val) {
            this._groupedFns = val
        }
    };

    checkIfEmpty(o) {
        return Object.keys(o).length === 0
    }

}
