2023-01-30 02:38:45 +01:00
|
|
|
import html from '../utils/html.js'
|
|
|
|
import markdown from '../utils/markdown.js'
|
|
|
|
import Date from './date.js'
|
|
|
|
|
2023-09-28 02:50:43 +02:00
|
|
|
/**
|
|
|
|
* @param {import('../schema.d.ts').ResumeSchema['awards']} awards
|
|
|
|
* @returns {string | false}
|
|
|
|
*/
|
2023-01-30 02:38:45 +01:00
|
|
|
export default function Awards(awards = []) {
|
2023-10-08 01:23:03 +02:00
|
|
|
return (
|
|
|
|
awards.length > 0 &&
|
|
|
|
html`
|
|
|
|
<section id="awards">
|
|
|
|
<h3>Awards</h3>
|
|
|
|
<div class="stack">
|
|
|
|
${awards.map(
|
|
|
|
({ awarder, date, summary, title }) => html`
|
|
|
|
<article>
|
|
|
|
<header>
|
|
|
|
<h4>${title}</h4>
|
|
|
|
<div class="meta">
|
|
|
|
${awarder && html`<div>Awarded by <strong>${awarder}</strong></div>`} ${date && Date(date)}
|
2023-01-30 02:38:45 +01:00
|
|
|
</div>
|
2023-10-08 01:23:03 +02:00
|
|
|
</header>
|
|
|
|
${summary && markdown(summary)}
|
|
|
|
</article>
|
|
|
|
`,
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
`
|
|
|
|
)
|
2023-01-30 02:38:45 +01:00
|
|
|
}
|