From 7e161e6ef81b2798aa91c8e705ec9e968675079a Mon Sep 17 00:00:00 2001
From: joonhoekim <26rote@gmail.com>
Date: Mon, 27 Oct 2025 19:53:08 +0900
Subject: (김준회) 자재그룹 선택기에서 코드를 보여주지 않는 선택기 추가개발,
 회원가입시 사용하도록 변경 *박성형프로요청
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../common/material/material-group-selector.tsx    | 30 ++++++++++++----------
 1 file changed, 17 insertions(+), 13 deletions(-)

(limited to 'components/common/material/material-group-selector.tsx')

diff --git a/components/common/material/material-group-selector.tsx b/components/common/material/material-group-selector.tsx
index f0276810..98625caa 100644
--- a/components/common/material/material-group-selector.tsx
+++ b/components/common/material/material-group-selector.tsx
@@ -33,6 +33,7 @@ interface MaterialGroupSelectorProps {
   excludeMaterialCodes?: Set<string>; // 제외할 자재그룹코드들
   showInitialData?: boolean; // 초기 클릭시 자재그룹들을 로드할지 여부
   maxSelections?: number; // 최대 선택 가능한 자재 개수 (1이면 단일 선택, undefined면 제한 없음)
+  hideCode?: boolean; // 자재그룹코드 표시 여부 (보호 목적)
 }
 
 export function MaterialGroupSelector({
@@ -46,7 +47,8 @@ export function MaterialGroupSelector({
   closeOnSelect = true,
   excludeMaterialCodes,
   showInitialData = true,
-  maxSelections
+  maxSelections,
+  hideCode = false
 }: MaterialGroupSelectorProps) {
   
   const [open, setOpen] = useState(false);
@@ -72,10 +74,10 @@ export function MaterialGroupSelector({
   const performSearch = useCallback(async (query: string, page: number = 1) => {
     setIsSearching(true);
     setSearchError(null);
-    
+
     try {
-      const result = await searchMaterialsForSelector(query, page, 10);
-      
+      const result = await searchMaterialsForSelector(query, page, 10, hideCode);
+
       if (result.success) {
         setSearchResults(result.data);
         setPagination(result.pagination);
@@ -107,7 +109,7 @@ export function MaterialGroupSelector({
     } finally {
       setIsSearching(false);
     }
-  }, []);
+  }, [hideCode]);
 
   // Popover 열림시 초기 데이터 로드
   React.useEffect(() => {
@@ -343,14 +345,16 @@ export function MaterialGroupSelector({
                                 </span>
                               )}
                             </div>
-                            <div className="text-xs text-muted-foreground">
-                              자재그룹코드: {material.materialGroupCode}
-                              {material.materialGroupUom && (
-                                <span className="ml-2">
-                                  | UOM: {material.materialGroupUom}
-                                </span>
-                              )}
-                            </div>
+                            {!hideCode && (
+                              <div className="text-xs text-muted-foreground">
+                                자재그룹코드: {material.materialGroupCode}
+                                {material.materialGroupUom && (
+                                  <span className="ml-2">
+                                    | UOM: {material.materialGroupUom}
+                                  </span>
+                                )}
+                              </div>
+                            )}
                           </div>
                         </CommandItem>
                       );
-- 
cgit v1.2.3

