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 {string[]} roles
|
|
|
|
* @returns {string}
|
|
|
|
*/
|
2023-10-08 01:23:03 +02:00
|
|
|
const formatRoles = roles => (Intl.ListFormat ? new Intl.ListFormat('en').format(roles) : roles.join(', '))
|
2023-01-30 02:38:45 +01:00
|
|
|
|
2023-09-28 02:50:43 +02:00
|
|
|
/**
|
|
|
|
* @param {import('../schema.d.ts').ResumeSchema['projects']} projects
|
|
|
|
* @returns {string | false}
|
|
|
|
*/
|
2023-01-30 02:38:45 +01:00
|
|
|
export default function Projects(projects = []) {
|
2023-10-08 01:23:03 +02:00
|
|
|
return (
|
|
|
|
projects.length > 0 &&
|
|
|
|
html`
|
|
|
|
<section id="projects">
|
|
|
|
<h3>Projects</h3>
|
|
|
|
<div class="stack">
|
|
|
|
${projects.map(
|
|
|
|
({
|
|
|
|
description,
|
|
|
|
entity,
|
|
|
|
highlights = [],
|
|
|
|
keywords = [],
|
|
|
|
name,
|
|
|
|
startDate,
|
|
|
|
endDate,
|
|
|
|
roles = [],
|
|
|
|
type,
|
|
|
|
url,
|
|
|
|
}) => html`
|
|
|
|
<article>
|
|
|
|
<header>
|
|
|
|
<h4>${Link(url, name)}</h4>
|
|
|
|
<div class="meta">
|
|
|
|
<div>
|
|
|
|
${roles.length > 0 && html`<strong>${formatRoles(roles)}</strong>`}
|
|
|
|
${entity && html`at <strong>${entity}</strong>`}
|
|
|
|
</div>
|
|
|
|
${startDate && html`<div>${Duration(startDate, endDate)}</div>`} ${type && html`<div>${type}</div>`}
|
|
|
|
</div>
|
|
|
|
</header>
|
|
|
|
${description && markdown(description)}
|
|
|
|
${highlights.length > 0 &&
|
|
|
|
html`
|
|
|
|
<ul>
|
|
|
|
${highlights.map(highlight => html`<li>${markdown(highlight)}</li>`)}
|
|
|
|
</ul>
|
|
|
|
`}
|
|
|
|
${keywords.length > 0 &&
|
|
|
|
html`
|
|
|
|
<ul class="tag-list">
|
|
|
|
${keywords.map(keyword => html`<li>${keyword}</li>`)}
|
|
|
|
</ul>
|
|
|
|
`}
|
|
|
|
</article>
|
|
|
|
`,
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
`
|
|
|
|
)
|
2023-01-30 02:38:45 +01:00
|
|
|
}
|