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

Function processSidebarItem

frontend/src/utils/route-utils.tsx:361–381  ·  view source on GitHub ↗

* Process a single sidebar item for legacy sidebar display.

(item: SidebarItem)

Source from the content-addressed store, hash-verified

359 * Process a single sidebar item for legacy sidebar display.
360 */
361function processSidebarItem(item: SidebarItem): NavLinkProps | null {
362 if (!item.icon) {
363 return null;
364 }
365
366 const visibility = item.visibilityCheck?.() ?? { visible: true, disabledReasons: [] };
367 if (!visibility.visible) {
368 return null;
369 }
370
371 const isEnabled = visibility.disabledReasons.length === 0;
372 const disabledText = getDisabledText(visibility.disabledReasons);
373
374 return {
375 title: String(item.title),
376 to: item.path,
377 icon: item.icon,
378 isDisabled: !isEnabled,
379 disabledText: disabledText || undefined,
380 };
381}
382
383/**
384 * Get disabled text from disabled reasons.

Callers 1

Calls 2

getDisabledTextFunction · 0.85
StringInterface · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…