added generateSidebarMenuItems util

This commit is contained in:
SrGooglo 2024-09-13 00:03:26 +00:00
parent 4157ba0e0c
commit 2872c9e449

View 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,
}
})
}