Files
Reservair/src/components/admin.js
T

14 lines
477 B
JavaScript
Raw Normal View History

2026-06-11 19:03:29 +02:00
function create_notice(id, type, mesg) {
let container = document.createElement('div');
container.id = id;
container.classList.add('notice', `notice-${type}`, 'settings-error', 'is-dismissible');
container.innerHTML = `<p><strong>${mesg}</strong></p>`;
return container;
}
2026-06-12 10:57:23 +00:00
export function show_notice(target, type, mesg) {
2026-06-11 19:03:29 +02:00
target.querySelectorAll('.notice').forEach(x => x.remove());
const notice = create_notice('test', type, mesg);
target.prepend(notice);
}