Function
getNavItem
({
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
| 4 | export type MenuItem = Required<MenuProps>['items'][number] |
| 5 | |
| 6 | export 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 | |
| 34 | export function getItem( |
| 35 | label: React.ReactNode, |
Tested by
no test coverage detected