feat access CRUD pages
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
export const findMenuItemByPath = (items: any[], targetPath: string): any | null => {
|
||||
for (const item of items || []) {
|
||||
if (item?.to === targetPath) {
|
||||
return item;
|
||||
}
|
||||
|
||||
if (Array.isArray(item?.children) && item.children.length > 0) {
|
||||
const found = findMenuItemByPath(item.children, targetPath);
|
||||
if (found) {
|
||||
return found;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
};
|
||||
Reference in New Issue
Block a user