2018-09-24 22:58:03 +02:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
import html from "choo/html";
|
|
|
|
|
|
|
|
function returnLinkTemplate(title, description, destination, label) {
|
|
|
|
return `
|
2018-09-24 23:14:50 +02:00
|
|
|
<li class="link-grid__link">
|
|
|
|
<p class="link-grid__title"><strong>${title}</strong></p>
|
|
|
|
<p class="link-grid__description">${description}</p>
|
|
|
|
<a class="link-grid__cta" href="${destination}">${label}</a>
|
2018-09-24 22:58:03 +02:00
|
|
|
</li>
|
|
|
|
`;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default (links) => {
|
|
|
|
const renderedLinks = links.map((link) => returnLinkTemplate(link.title, link.description, link.destination, link.label));
|
|
|
|
return html`
|
2018-09-24 23:14:50 +02:00
|
|
|
<ul class="link-grid">
|
|
|
|
${renderedLinks}
|
2018-09-24 22:58:03 +02:00
|
|
|
</ul>
|
|
|
|
`;
|
|
|
|
}
|