From 14b3f4259ddf900e00fc64b9f367027be55b0e38 Mon Sep 17 00:00:00 2001
From: joonhoekim <26rote@gmail.com>
Date: Thu, 27 Nov 2025 22:37:27 +0900
Subject: (김준회) 페이지네이션 기본값 전체 데이터 개수로 설정, 한국어 텍스트
 번역
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/dolce/table/drawing-list-table-v2.tsx | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

(limited to 'lib/dolce/table/drawing-list-table-v2.tsx')

diff --git a/lib/dolce/table/drawing-list-table-v2.tsx b/lib/dolce/table/drawing-list-table-v2.tsx
index 929a1252..3af09689 100644
--- a/lib/dolce/table/drawing-list-table-v2.tsx
+++ b/lib/dolce/table/drawing-list-table-v2.tsx
@@ -44,7 +44,7 @@ interface DrawingListTableV2Props<TData extends DrawingData, TValue> {
   getRowId?: (row: TData) => string;
   maxHeight?: string; // e.g., "45vh"
   minHeight?: string; // e.g., "400px"
-  defaultPageSize?: number | "all"
+  defaultPageSize?: number;
 }
 
 export function DrawingListTableV2<TData extends DrawingData, TValue>({
@@ -55,11 +55,12 @@ export function DrawingListTableV2<TData extends DrawingData, TValue>({
   getRowId,
   maxHeight,
   minHeight = "400px",
-  defaultPageSize = 10,
+  defaultPageSize,
 }: DrawingListTableV2Props<TData, TValue>) {
   const [sorting, setSorting] = useState<SortingState>([]);
   const [pageIndex, setPageIndex] = useState(0);
-  const [pageSize, setPageSize] = useState(defaultPageSize);
+  // defaultPageSize가 없으면 전체 데이터 길이를 사용
+  const [pageSize, setPageSize] = useState(defaultPageSize ?? data.length);
 
   // 기본 getRowId 함수: RegisterGroupId + DrawingNo + Discipline + CreateDt 조합
   const defaultGetRowId = (row: TData): string => {
@@ -105,7 +106,7 @@ export function DrawingListTableV2<TData extends DrawingData, TValue>({
   };
 
   const handlePageSizeChange = (value: string) => {
-    const newSize = value === "all" ? data.length : parseInt(value);
+    const newSize = value === "all" ? data.length : parseInt(value, 10);
     setPageSize(newSize);
     setPageIndex(0);
   };
@@ -202,7 +203,7 @@ export function DrawingListTableV2<TData extends DrawingData, TValue>({
                   style={{ height: "300px" }}
                 >
                   <div className="flex items-center justify-center h-full">
-                    데이터가 없습니다.
+                    No Data.
                   </div>
                 </TableCell>
               </TableRow>
-- 
cgit v1.2.3

