From bcd462d6e60871b86008e072f4b914138fc5c328 Mon Sep 17 00:00:00 2001
From: joonhoekim <26rote@gmail.com>
Date: Mon, 11 Aug 2025 09:34:40 +0000
Subject: (김준회) 리치텍스트에디터 (결재템플릿을 위한 공통컴포넌트),
 command-menu 에러 수정, 결재 템플릿 관리, 결재선 관리, ECC RFQ+PR Item 수신시
 비즈니스테이블(ProcurementRFQ) 데이터 적재, WSDL 오류 수정
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 components/layout/command-menu.tsx | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

(limited to 'components/layout/command-menu.tsx')

diff --git a/components/layout/command-menu.tsx b/components/layout/command-menu.tsx
index 5537a042..d0c9c49a 100644
--- a/components/layout/command-menu.tsx
+++ b/components/layout/command-menu.tsx
@@ -1,12 +1,13 @@
 "use client"
 
 import * as React from "react"
-import { useRouter,usePathname } from "next/navigation"
+import { useRouter, usePathname, useParams } from "next/navigation"
 import { type DialogProps } from "@radix-ui/react-dialog"
 import { Circle, File, Laptop, Moon, Sun } from "lucide-react"
 import { useTheme } from "next-themes"
 
 import { MenuSection, mainNav, additionalNav, MenuItem, mainNavVendor, additionalNavVendor } from "@/config/menuConfig";
+import { useTranslation } from "@/i18n/client"
 import { cn } from "@/lib/utils"
 import { Button } from "@/components/ui/button"
 import {
@@ -24,6 +25,9 @@ export function CommandMenu({ ...props }: DialogProps) {
   const router = useRouter()
   const [open, setOpen] = React.useState(false)
   const { setTheme } = useTheme()
+  const params = useParams()
+  const lng = (params?.lng as string) || "evcp"
+  const { t } = useTranslation(lng, "menu")
 
   React.useEffect(() => {
     const down = (e: KeyboardEvent) => {
@@ -81,20 +85,20 @@ const isPartnerRoute = pathname.includes("/partners");
         <CommandList>
           <CommandEmpty>No results found.</CommandEmpty>
 
-          {main.map((group) => (
-            <CommandGroup key={group.title} heading={group.title}>
+          {main.map((group: MenuSection) => (
+            <CommandGroup key={group.titleKey} heading={t(group.titleKey)}>
               {group.items.map((navItem) => (
                 <CommandItem
-                  key={navItem.title}
-                  value={navItem.title}
+                  key={`${navItem.titleKey}:${navItem.href}`}
+                  value={t(navItem.titleKey)}
                   onSelect={() => {
-                    runCommand(() => router.push(navItem.href as string))
+                    runCommand(() => router.push(`/${lng}${navItem.href}`))
                   }}
                 >
                   <div className="mr-2 flex h-4 w-4 items-center justify-center">
                     <Circle className="h-3 w-3" />
                   </div>
-                  {navItem.title}
+                  {t(navItem.titleKey)}
                 </CommandItem>
               ))}
             </CommandGroup>
@@ -104,14 +108,14 @@ const isPartnerRoute = pathname.includes("/partners");
               // .filter((navitem) => !navitem.external)
               .map((navItem) => (
                 <CommandItem
-                  key={navItem.title}
-                  value={navItem.title}
+                  key={`${navItem.titleKey}:${navItem.href}`}
+                  value={t(navItem.titleKey)}
                   onSelect={() => {
-                    runCommand(() => router.push(navItem.href as string))
+                    runCommand(() => router.push(`/${lng}${navItem.href}`))
                   }}
                 >
                   <File />
-                  {navItem.title}
+                  {t(navItem.titleKey)}
                 </CommandItem>
               ))}
           </CommandGroup>
-- 
cgit v1.2.3

