function copyToClipboardButton(data, title = 'copy to clipboard') {
const bt = html`<button> ${title}`;
const el = document.createElement('input');
el.style.cssText = 'padding:0;margin:0;border:0;width:1px;opacity:0';
bt.appendChild(el);
bt.onclick = async () => {
el.value = typeof data === "string" ? data : JSON.stringify(data);
el.select();
console.log(el);
document.execCommand("copy");
};
return bt;
}