Before repair nav components
All checks were successful
Deploy Docs to Synology / deploy (push) Successful in 4s

This commit is contained in:
2026-04-25 11:24:39 +02:00
parent e842ed8041
commit 910c6ab3c7
71 changed files with 4260 additions and 2819 deletions

View File

@@ -0,0 +1,32 @@
// components/Menu.js
import { h, each } from "sigpro";
export const Menu = (props, children) => {
children === undefined && (children = props, props = {});
return h("ul", { ...props, class: `menu ${props.class ?? ''}` }, children);
};
export const MenuItems = (props) => {
const { items, keyFn = (item, idx) => item.id ?? idx } = props;
const itemsSignal = typeof items === "function" ? items : () => items || [];
const renderItem = (item) => {
if (item.children) {
return h("li", {}, [
h("details", {}, [
h("summary", {}, item.label),
h("ul", {}, MenuItems({ items: item.children }))
])
]);
}
return h("li", {}, h("a", {
href: item.href,
onclick: item.onclick ? (e) => {
if (!item.href) e.preventDefault();
item.onclick(e);
} : null
}, item.label));
};
return each(itemsSignal, renderItem, keyFn);
};