entity-search-iniput 수정
This commit is contained in:
@@ -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>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user