MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / getNavItem

Function getNavItem

frontend/packages/common/src/utils/navigation.tsx:6–32  ·  view source on GitHub ↗
({
  label,
  key,
  path,
  icon,
  children,
  type,
  access
}: {
  label: React.ReactNode
  key: React.Key
  path?: string
  icon?: React.ReactNode
  children?: MenuItem[]
  type?: 'group'
  access?: string[] | string
})

Source from the content-addressed store, hash-verified

4export type MenuItem = Required<MenuProps>['items'][number]
5
6export function getNavItem({
7 label,
8 key,
9 path,
10 icon,
11 children,
12 type,
13 access
14}: {
15 label: React.ReactNode
16 key: React.Key
17 path?: string
18 icon?: React.ReactNode
19 children?: MenuItem[]
20 type?: 'group'
21 access?: string[] | string
22}): MenuItem {
23 return {
24 key,
25 icon,
26 routes: children,
27 name: label,
28 type,
29 access,
30 path
31 } as MenuItem
32}
33
34export function getItem(
35 label: React.ReactNode,

Callers 1

transformMenuDataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected