entity-search-iniput 수정

This commit is contained in:
leeheejin
2026-01-21 11:40:47 +09:00
parent e8fc664352
commit 29a4ab7b9d
5 changed files with 166 additions and 18 deletions

View File

@@ -148,9 +148,9 @@ export function EntitySearchModal({
</th>
)}
{displayColumns.map((col) => (
{displayColumns.map((col, colIdx) => (
<th
key={col}
key={col || `header-${colIdx}`}
className="px-4 py-2 text-left font-medium text-muted-foreground"
>
{col}
@@ -179,7 +179,8 @@ export function EntitySearchModal({
</tr>
) : (
results.map((item, index) => {
const uniqueKey = item[valueField] !== undefined ? `${item[valueField]}` : `row-${index}`;
// null과 undefined 모두 체크하여 유니크 키 생성
const uniqueKey = item[valueField] != null ? `${item[valueField]}` : `row-${index}`;
const isSelected = isItemSelected(item);
return (
<tr
@@ -200,8 +201,8 @@ export function EntitySearchModal({
/>
</td>
)}
{displayColumns.map((col) => (
<td key={`${uniqueKey}-${col}`} className="px-4 py-2">
{displayColumns.map((col, colIdx) => (
<td key={`${uniqueKey}-${col || colIdx}`} className="px-4 py-2">
{item[col] || "-"}
</td>
))}