mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 10:34:17 +00:00
added generateSidebarMenuItems
util
This commit is contained in:
parent
4157ba0e0c
commit
2872c9e449
19
packages/app/src/utils/generateSidebarMenuItems/index.jsx
Normal file
19
packages/app/src/utils/generateSidebarMenuItems/index.jsx
Normal file
@ -0,0 +1,19 @@
|
||||
import { Translation } from "react-i18next"
|
||||
import { createIconRender } from "@components/Icons"
|
||||
|
||||
export default (items) => {
|
||||
return items.map((item) => {
|
||||
return {
|
||||
id: item.id,
|
||||
key: item.id,
|
||||
path: item.path,
|
||||
icon: createIconRender(item.icon),
|
||||
label: <Translation>
|
||||
{t => t(item.title ?? item.label ?? item.id)}
|
||||
</Translation>,
|
||||
danger: item.danger,
|
||||
disabled: item.disabled,
|
||||
children: item.children,
|
||||
}
|
||||
})
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user