MCPcopy
hub / github.com/redpanda-data/console / createGroupedSidebarItems

Function createGroupedSidebarItems

frontend/src/utils/route-utils.tsx:416–437  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

414 * Filters invisible items and omits empty groups.
415 */
416export 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.

Callers 2

sidebar.test.tsxFile · 0.90
SidebarNavigationFunction · 0.90

Calls 3

processSidebarItemFunction · 0.85
setMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…