mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-07 09:08:14 -07:00
20 lines
454 B
JavaScript
20 lines
454 B
JavaScript
/** @param {string} title */
|
|
function groupName(title) {
|
|
return title.toLowerCase().replace(/[^a-z0-9]+/g, "-");
|
|
}
|
|
|
|
/**
|
|
* @param {HTMLElement} parent
|
|
* @param {string} title
|
|
* @param {Node[]} children
|
|
*/
|
|
export function appendPane(parent, title, children) {
|
|
if (!children.length) return;
|
|
|
|
const section = document.createElement("section");
|
|
|
|
section.dataset.group = groupName(title);
|
|
section.append(...children);
|
|
parent.append(section);
|
|
}
|