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

export const createElectionResultListItem =
  ({
     image = './dummy/election-list-cover.jpg',
     name = 'Lars-Hendrick Pirckensee',
     job = 'Grundstücksmakler, Immobilenemakler',
     city = 'Kreisfreie Musterstadt, Musterhausen',
  }) => {
    const electionResultListItem = createElement('div', ['election-result-list-item', 'variant-subtle-primary']);
    const topBox = createElement('a', ['top-box'], null, electionResultListItem);
    topBox.href = '#';
    const imageBox = createElement('div', ['image-box'], null, topBox);
    createImage(image, 310, 310, '', [], imageBox);
    const copy = createElement('span', ['copyright'], name, imageBox);
    copy.setAttribute("aria-hidden", "true");
    createElement('span', ['sr-only'], name, imageBox);
    createElement('h3', [], name, topBox);

    const textBox = createElement('div', ['text-box'], null, electionResultListItem);
    const jobBox = createElement('div', ['job-box'], null, textBox);
    const jobBoxLink = createElement('a', ['icon-small-election-group'], job, jobBox);
    jobBoxLink.href = '#';
    const cityBox = createElement('div', ['city-box'], null, textBox);
    const cityBoxLink = createElement('a', ['icon-small-icon-election-location'], city, cityBox);
    cityBoxLink.href = '#';

    return electionResultListItem;
  }