summaryrefslogtreecommitdiff
path: root/src/components/ListTable.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/ListTable.tsx')
-rw-r--r--src/components/ListTable.tsx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/components/ListTable.tsx b/src/components/ListTable.tsx
index 9315a27..85b86aa 100644
--- a/src/components/ListTable.tsx
+++ b/src/components/ListTable.tsx
@@ -6,13 +6,14 @@ interface Field {
}
interface Props {
- items: any[];
+ items?: any[];
fields: Field[];
handleRowClick?: (index: number) => void;
}
-const ListTable: React.FC<Props> = ({ items, fields, handleRowClick = () => {} }) => {
+const ListTable: React.FC<Props> = ({ items = [], fields, handleRowClick = () => {} }) => {
+ if (!items.length) return <div className="text-center p-6">No data</div>;
return (
<table className="table-auto w-full">
<thead>