diff options
Diffstat (limited to 'lib/swp/table/swp-table.tsx')
| -rw-r--r-- | lib/swp/table/swp-table.tsx | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/swp/table/swp-table.tsx b/lib/swp/table/swp-table.tsx index 9e8f7f6a..fb3a504e 100644 --- a/lib/swp/table/swp-table.tsx +++ b/lib/swp/table/swp-table.tsx @@ -1,6 +1,6 @@ "use client"; -import { useState } from "react"; +import React, { useState } from "react"; import { useReactTable, getCoreRowModel, @@ -53,7 +53,7 @@ export function SwpTable({ onExpandedChange: setExpanded, getCoreRowModel: getCoreRowModel(), getExpandedRowModel: getExpandedRowModel(), - getRowCanExpand: (row) => true, // 모든 문서는 확장 가능 + getRowCanExpand: () => true, // 모든 문서는 확장 가능 }); // 리비전 로드 @@ -106,7 +106,7 @@ export function SwpTable({ // 문서 행 확장 핸들러 const handleDocumentExpand = (docNo: string, isExpanded: boolean) => { - if (!isExpanded) { + if (isExpanded) { loadRevisions(docNo); } }; @@ -135,10 +135,9 @@ export function SwpTable({ <TableBody> {table.getRowModel().rows?.length ? ( table.getRowModel().rows.map((row) => ( - <> + <React.Fragment key={row.id}> {/* 문서 행 */} <TableRow - key={row.id} data-state={row.getIsSelected() && "selected"} className="hover:bg-muted/50" > @@ -187,7 +186,7 @@ export function SwpTable({ </TableCell> </TableRow> )} - </> + </React.Fragment> )) ) : ( <TableRow> @@ -264,7 +263,7 @@ function RevisionSubTable({ }); const handleRevisionExpand = (revisionId: number, isExpanded: boolean) => { - if (!isExpanded) { + if (isExpanded) { onLoadFiles(revisionId); } }; @@ -290,9 +289,9 @@ function RevisionSubTable({ </TableHeader> <TableBody> {revisionTable.getRowModel().rows.map((row) => ( - <> + <React.Fragment key={row.id}> {/* 리비전 행 */} - <TableRow key={row.id} className="bg-muted/20"> + <TableRow className="bg-muted/20"> {row.getVisibleCells().map((cell) => ( <TableCell key={cell.id}> {cell.column.id === "expander" ? ( @@ -333,7 +332,7 @@ function RevisionSubTable({ </TableCell> </TableRow> )} - </> + </React.Fragment> ))} </TableBody> </Table> |
