2023-01-30 02:38:45 +01:00
|
|
|
import html from '../utils/html.js'
|
|
|
|
import markdown from '../utils/markdown.js'
|
|
|
|
import Duration from './duration.js'
|
|
|
|
import Link from './link.js'
|
|
|
|
|
2023-09-28 02:50:43 +02:00
|
|
|
/**
|
|
|
|
* @param {import('../schema.d.ts').ResumeSchema['volunteer']} volunteer
|
|
|
|
* @returns {string | false}
|
|
|
|
*/
|
2023-01-30 02:38:45 +01:00
|
|
|
export default function Volunteer(volunteer = []) {
|
|
|
|
return volunteer.length > 0 && html`
|
|
|
|
<section id="volunteer">
|
|
|
|
<h3>Volunteer</h3>
|
|
|
|
<div class="stack">
|
|
|
|
${volunteer.map(({ highlights = [], organization, position, startDate, endDate, summary, url }) => html`
|
|
|
|
<article>
|
|
|
|
<header>
|
2023-08-08 00:32:37 +02:00
|
|
|
<h4>${Link(url, organization)}</h4>
|
2023-01-30 02:38:45 +01:00
|
|
|
<div class="meta">
|
2023-08-08 00:32:37 +02:00
|
|
|
<strong>${position}</strong>
|
2023-09-28 02:50:43 +02:00
|
|
|
${startDate && html`<div>${Duration(startDate, endDate)}</div>`}
|
2023-01-30 02:38:45 +01:00
|
|
|
</div>
|
|
|
|
</header>
|
|
|
|
${summary && markdown(summary)}
|
|
|
|
${highlights.length > 0 && html`
|
|
|
|
<ul>
|
|
|
|
${highlights.map(highlight => html`<li>${markdown(highlight)}</li>`)}
|
|
|
|
</ul>
|
|
|
|
`}
|
|
|
|
</article>
|
|
|
|
`)}
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
`
|
|
|
|
}
|