From b12a06766e32e3c76544b1d12bec91653e1fe9db Mon Sep 17 00:00:00 2001 From: 0-Zz-ang Date: Mon, 25 Aug 2025 09:23:30 +0900 Subject: docu-list-rule페이지 수정 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/docu-list-rule/dynamic-title-client.tsx | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 components/docu-list-rule/dynamic-title-client.tsx (limited to 'components/docu-list-rule/dynamic-title-client.tsx') diff --git a/components/docu-list-rule/dynamic-title-client.tsx b/components/docu-list-rule/dynamic-title-client.tsx new file mode 100644 index 00000000..46517cbc --- /dev/null +++ b/components/docu-list-rule/dynamic-title-client.tsx @@ -0,0 +1,52 @@ +"use client" + +import { usePathname } from "next/navigation" +import { useEffect, useState } from "react" + +export function DynamicTitleClient() { + const pathname = usePathname() + const [currentTitle, setCurrentTitle] = useState("") + const [isLoading, setIsLoading] = useState(true) + + useEffect(() => { + // 로딩 상태를 true로 설정 + setIsLoading(true) + + // 약간의 지연 후 제목 설정 (로딩 효과 방지) + const timer = setTimeout(() => { + let title = "" + + if (pathname?.includes("/document-class")) { + title = "Document Class 관리" + } else if (pathname?.includes("/code-groups")) { + title = "Code Group 정의" + } else if (pathname?.includes("/combo-box-settings")) { + title = "Combo Box 설정" + } else if (pathname?.includes("/number-types")) { + title = "Number Type 관리" + } else if (pathname?.includes("/number-type-configs")) { + title = "Number Type별 설정" + } else { + title = "Document Numbering Rule (해양)" + } + + setCurrentTitle(title) + setIsLoading(false) + }, 100) // 100ms 지연 + + return () => clearTimeout(timer) + }, [pathname]) + + // 로딩 중에는 아무것도 표시하지 않음 + if (isLoading) { + return
+

 

+
+ } + + return ( +
+

{currentTitle}

+
+ ) +} -- cgit v1.2.3