From 44b74ff4170090673b6eeacd8c528e0abf47b7aa Mon Sep 17 00:00:00 2001
From: joonhoekim <26rote@gmail.com>
Date: Mon, 1 Dec 2025 19:52:06 +0900
Subject: (김준회) deprecated code 정리
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 components/layout/Header.tsx | 57 ++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 55 insertions(+), 2 deletions(-)

(limited to 'components/layout/Header.tsx')

diff --git a/components/layout/Header.tsx b/components/layout/Header.tsx
index 0c83e858..2752948a 100644
--- a/components/layout/Header.tsx
+++ b/components/layout/Header.tsx
@@ -123,7 +123,60 @@ export function Header() {
     }, [pathname]);
 
     // 도메인별 메뉴 및 브랜딩 정보 가져오기
-    const getDomainConfig = (pathname: string | null) => {
+    // session.user.domain이 있으면 그것을 우선적으로 따르고, 없으면 pathname을 따릅니다.
+    const userDomain = (session?.user as { domain?: string } | undefined)?.domain;
+
+    const getDomainConfig = (pathname: string | null, domain?: string) => {
+        // 1. 세션 도메인 기반 설정
+        if (domain) {
+            if (domain === "partners") {
+                return {
+                    main: mainNavVendor,
+                    additional: additionalNavVendor,
+                    logoHref: `/${lng}/partners`,
+                    brandNameKey: domainBrandingKeys.partners,
+                    basePath: `/${lng}/partners`
+                };
+            }
+            if (domain === "procurement") {
+                return {
+                    main: procurementNav,
+                    additional: additional2Nav,
+                    logoHref: `/${lng}/procurement`,
+                    brandNameKey: domainBrandingKeys.procurement,
+                    basePath: `/${lng}/procurement`
+                };
+            }
+            if (domain === "sales") {
+                return {
+                    main: salesNav,
+                    additional: additional2Nav,
+                    logoHref: `/${lng}/sales`,
+                    brandNameKey: domainBrandingKeys.sales,
+                    basePath: `/${lng}/sales`
+                };
+            }
+            if (domain === "engineering") {
+                return {
+                    main: engineeringNav,
+                    additional: additional2Nav,
+                    logoHref: `/${lng}/engineering`,
+                    brandNameKey: domainBrandingKeys.engineering,
+                    basePath: `/${lng}/engineering`
+                };
+            }
+            if (domain === "evcp") {
+                return {
+                    main: mainNav,
+                    additional: additionalNav,
+                    logoHref: `/${lng}/evcp`,
+                    brandNameKey: domainBrandingKeys.evcp,
+                    basePath: `/${lng}/evcp`
+                };
+            }
+        }
+
+        // 2. 경로 기반 설정 (Fallback)
         if (pathname?.includes("/partners")) {
             return {
                 main: mainNavVendor,
@@ -174,7 +227,7 @@ export function Header() {
         };
     };
 
-    const { main: originalMain, additional: originalAdditional, logoHref, brandNameKey, basePath } = getDomainConfig(pathname);
+    const { main: originalMain, additional: originalAdditional, logoHref, brandNameKey, basePath } = getDomainConfig(pathname, userDomain);
 
     // partners 도메인 여부 확인
     const isPartners = pathname?.includes("/partners") ?? false;
-- 
cgit v1.2.3

