summaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/ListTable.tsx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/components/ListTable.tsx b/src/components/ListTable.tsx
index 5c1333a..c333698 100644
--- a/src/components/ListTable.tsx
+++ b/src/components/ListTable.tsx
@@ -1,4 +1,5 @@
import React from 'react';
+import _ from 'lodash';
interface Field {
key: string;
@@ -28,7 +29,7 @@ const ListTable: React.FC<Props> = ({ items = [], fields, handleRowClick = () =>
className={`border-b hover:bg-gray-100 cursor-pointer ${index % 2 && 'bg-gray-50'}`}
onClick={() => handleRowClick(index)}
>
- {fields.map(field => <td key={`${item._id} ${field.label}`} className="p-3">{item[field.key]}</td>)}
+ {fields.map(field => <td key={`${item._id} ${field.label}`} className="p-3">{_.get(item, field.key)}</td>)}
</tr>
))}
</tbody>