import '././election-result-list-badge.scss';
import {createElement} from "../../_global/scripts/helpers";

export const createElectionResultListBadge =
  ({
     preLabel = '202',
     label = 'Kandidat:innen',
     inverted = false,
     closable = false,
     colon = false,
  }) => {

    const electionResultListBadge = createElement('div', [
        'election-result-list-badge',
        ...(inverted
            ? ['variant-solid', 'variant-subtle-primary-hover', 'inverted']
            : ['variant-subtle-primary', 'normal']),
        closable ? 'closable' : 'regular'
    ]);
    const inner = createElement('div', ['badge-inner'], null, electionResultListBadge);
    const pPre = preLabel + (colon ? ': ' : '');
    const p = createElement('p', [], pPre, inner);
    createElement('span', [], label, p);

    return electionResultListBadge;
  }
