From 10e55d87a6d29fdff476da4838f9dedc1908c2ec Mon Sep 17 00:00:00 2001 From: Mohan Ki Date: Mon, 27 Jul 2026 19:00:45 +0530 Subject: [PATCH] feat(admin): Convert settings layout to use tabbed navigation, isolating SMTP configuration --- client/src/app/admin/settings/page.tsx | 44 ++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/client/src/app/admin/settings/page.tsx b/client/src/app/admin/settings/page.tsx index c1109ee..c8de7a8 100644 --- a/client/src/app/admin/settings/page.tsx +++ b/client/src/app/admin/settings/page.tsx @@ -49,6 +49,15 @@ export default function AdminSettingsPage() { return acc; }, {} as Record); + const categories = Object.keys(groupedSettings); + const [activeTab, setActiveTab] = useState(''); + + useEffect(() => { + if (categories.length > 0 && !activeTab) { + setActiveTab(categories[0]); + } + }, [categories, activeTab]); + return (
@@ -72,19 +81,40 @@ export default function AdminSettingsPage() {
+ {categories.length > 0 && ( +
+ +
+ )} +
- {Object.keys(groupedSettings).map(category => ( -
- + {activeTab && groupedSettings[activeTab] && ( +
{/* Category Header */}
-

{category} Configuration

+

{activeTab} Configuration

- {groupedSettings[category].map(setting => { - const isSecret = setting.key.includes('key') || setting.key.includes('secret') || setting.key.includes('password'); + {groupedSettings[activeTab].map(setting => { + const isSecret = setting.key.includes('key') || setting.key.includes('secret') || setting.key.includes('password') || setting.key.includes('pass'); return (
- ))} + )}
);