From 155539693cd27993966a09738181dd11ec8390b1 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 29 May 2026 14:51:20 +0800 Subject: [PATCH] refactor: flatten admin settings header --- .../_components/admin-settings-navigation.tsx | 192 ++++++++---------- 1 file changed, 86 insertions(+), 106 deletions(-) diff --git a/app/(admin)/settings/_components/admin-settings-navigation.tsx b/app/(admin)/settings/_components/admin-settings-navigation.tsx index ce6465a57..4a08e25a6 100644 --- a/app/(admin)/settings/_components/admin-settings-navigation.tsx +++ b/app/(admin)/settings/_components/admin-settings-navigation.tsx @@ -33,12 +33,6 @@ function getActiveGroup(activeTab: string) { ); } -function getActiveItem(activeTab: string) { - return ADMIN_SETTINGS_NAV_GROUPS.flatMap((group) => group.items).find( - (item) => item.value === activeTab - ); -} - function SettingsGroupDropdown({ activeTab, group, @@ -166,123 +160,109 @@ export function AdminSettingsNavigation({ onTabChange: (value: string) => void; }) { const activeGroup = getActiveGroup(activeTab); - const activeItem = getActiveItem(activeTab); - const ActiveIcon = activeItem?.icon; return (
-
-
-
-
- Admin Console - {activeGroup ? ( - <> - - - {activeGroup.title} - - - ) : null} -
- -
-

- 系统设置中心 -

- {activeItem && ActiveIcon ? ( -
-
- -
-
-
- - {activeItem.label} - - 当前 -
-
-
- ) : null} -
-
+
+
+
-
-
- - -
- {(activeGroup?.items ?? []).map((item) => ( - - ))} -
-
- -
-
- {ADMIN_SETTINGS_NAV_GROUPS.map((group) => ( - - ))} - - - - {(activeGroup?.items ?? []).map((item) => ( - - ))} -
-
+
+ {(activeGroup?.items ?? []).map((item) => ( + + ))}
+ +
+
+ Admin Console +
+ + {activeGroup ? ( + <> + + + {activeGroup.title} + + + ) : null} + + + +
+ {ADMIN_SETTINGS_NAV_GROUPS.map((group) => ( + + ))} + + + + {(activeGroup?.items ?? []).map((item) => ( + + ))} +
+ + +
); }