refactor: replace Jinja templates with static frontend pages

This commit is contained in:
2026-06-16 03:35:41 +00:00
parent 2874680ffa
commit 593dece92b
39 changed files with 3532 additions and 2801 deletions
+40
View File
@@ -0,0 +1,40 @@
/**
* Hoover — components/toast.js
*
* ToastContainer component that renders queued toast notifications.
* Uses the toast/dismissToast state from api.js.
*/
import { h } from '../vdom.js';
import { _toasts, dismissToast } from '../api.js';
/**
* Render all pending toast notifications.
*
* @returns {VNode}
*/
export function ToastContainer() {
if (!_toasts.length) return h('#text', '');
const clsMap = {
info: 'toast-info',
success: 'toast-success',
error: 'toast-error',
warning: 'toast-warning',
};
return h('div', { class: 'toast-container' },
..._toasts.map(t =>
h('div', {
class: `toast ${clsMap[t.type] || clsMap.info}`,
'on:click': () => dismissToast(t.id),
},
h('span', null, t.message),
h('button', {
class: 'toast-close',
'on:click': (e) => { e.stopPropagation(); dismissToast(t.id); },
}, '\u00d7'),
),
),
);
}