import './linklist.scss';
import {createElement} from "../../_global/scripts/helpers";
import {linkListData} from "./LinkListData";

export const createLinkList =
  ({
    links = linkListData,
  }) => {
    const ul = createElement('ul', ['linklist','variant-base'], null);
    links.map((item) => {
      const li = createElement('li', [], null, ul);
      const a = createElement('a', [item.type], item.title, li);
      a.href = item.link;
      if (item.copy && item.copy.length > 0) {
        createElement('p', [], item.copy, li);
      }
    })
    return ul;
  }