()
| 414 | * Filters invisible items and omits empty groups. |
| 415 | */ |
| 416 | export function createGroupedSidebarItems(): SidebarGroupedItems[] { |
| 417 | const groupMap = new Map<string, NavLinkProps[]>(); |
| 418 | |
| 419 | for (const section of SECTION_ORDER) { |
| 420 | groupMap.set(section, []); |
| 421 | } |
| 422 | |
| 423 | for (const item of SIDEBAR_ITEMS) { |
| 424 | const processed = processSidebarItem(item); |
| 425 | if (processed && item.group) { |
| 426 | const list = groupMap.get(item.group); |
| 427 | if (list) { |
| 428 | list.push(processed); |
| 429 | } |
| 430 | } |
| 431 | } |
| 432 | |
| 433 | return SECTION_ORDER.map((section) => ({ |
| 434 | group: section, |
| 435 | items: groupMap.get(section) ?? [], |
| 436 | })).filter((g) => g.items.length > 0); |
| 437 | } |
| 438 | |
| 439 | /** |
| 440 | * Get filtered routes for embedded mode. |
no test coverage detected
searching dependent graphs…