mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-26 02:08:10 -07:00
website: redesign part 33
This commit is contained in:
@@ -3,22 +3,36 @@ import { createElement } from "../dom.js";
|
||||
/**
|
||||
* @typedef {Object} EmptyOptions
|
||||
* @property {() => void} onAdd
|
||||
* @property {() => void} [onClear]
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {EmptyOptions} options
|
||||
*/
|
||||
export function createEmpty(options) {
|
||||
const empty = createElement("section", "wallets__empty");
|
||||
const empty = createElement("section", "empty");
|
||||
const title = document.createElement("h1");
|
||||
const text = document.createElement("p");
|
||||
const actions = document.createElement("menu");
|
||||
const button = document.createElement("button");
|
||||
|
||||
text.append("No wallet imported yet");
|
||||
title.append("No wallet yet");
|
||||
text.append("Import an xpub or watch-only descriptor to start watching activity.");
|
||||
button.type = "button";
|
||||
button.classList.add("primary");
|
||||
button.append("Add wallet");
|
||||
button.addEventListener("click", options.onAdd);
|
||||
empty.append(text, button);
|
||||
actions.append(button);
|
||||
|
||||
if (options.onClear) {
|
||||
const clear = document.createElement("button");
|
||||
|
||||
clear.type = "button";
|
||||
clear.append("Clear");
|
||||
clear.addEventListener("click", options.onClear);
|
||||
actions.append(clear);
|
||||
}
|
||||
|
||||
empty.append(title, text, actions);
|
||||
|
||||
return empty;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user