chore: getCurrentMenu 수정

This commit is contained in:
2025-04-10 18:18:35 +09:00
parent 93e066ebe5
commit 694cd4893e
7 changed files with 17 additions and 13 deletions
+5 -1
View File
@@ -5,7 +5,11 @@ export const getCurrentMenu = (
pathname: string,
): MenuItem | null => {
for (const menu of menus) {
if (menu.urlPath === pathname) return menu;
if (
menu.urlPath !== "" &&
(menu.urlPath === pathname || pathname.startsWith(menu.urlPath))
)
return menu;
if (menu.children) {
const children = getCurrentMenu(menu.children, pathname);