web: start: serparator for menu

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-06-02 15:03:39 +02:00
commit 3323da955d
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
4 changed files with 48 additions and 16 deletions

View file

@ -76,6 +76,14 @@ class SideNav extends HTMLElement {
const current = this.#currentHref()
const links = this.#items.map(item => {
if (item.type === 'separator') {
return `<div class="separator"></div>`
}
if (item.type === 'section') {
return `<div class="section-header">${item.label ?? ''}</div>`
}
// Skip malformed entries (missing href or label)
if (!item.href || !item.label) return ''
const active = item.href === current
return `<a href="${item.href}" class="item ${active ? 'active' : ''}">
<span class="icon">${resolveIcon(item.icon)}</span>