You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
479 B
20 lines
479 B
module.exports = function displayBlock ({dom, content, title}) {
|
|
const block = document.createElement('div')
|
|
block.className = 'block'
|
|
|
|
if (title) {
|
|
const header = document.createElement('h3')
|
|
header.innerHTML = title
|
|
block.appendChild(header)
|
|
}
|
|
|
|
if (typeof content === 'string') {
|
|
const div = document.createElement('div')
|
|
div.innerHTML = content
|
|
block.appendChild(div)
|
|
} else {
|
|
block.appendChild(content)
|
|
}
|
|
|
|
dom.appendChild(block)
|
|
}
|