From abe3641c3d0e959489ac185aa939f85725d8534f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Feb 2023 02:05:51 +0600 Subject: [PATCH] updated --- build/react-table/Table.js | 2 +- src/react-table/Table.jsx | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build/react-table/Table.js b/build/react-table/Table.js index b336c5e..7b76e64 100644 --- a/build/react-table/Table.js +++ b/build/react-table/Table.js @@ -18,7 +18,7 @@ export default function ReactTable({ setSearchBy, total, title, - data, + data = [], emptyMessage = "Sorry, no data found", footer = false, header = true, diff --git a/src/react-table/Table.jsx b/src/react-table/Table.jsx index 881f1dd..70b0164 100644 --- a/src/react-table/Table.jsx +++ b/src/react-table/Table.jsx @@ -17,7 +17,7 @@ export default function ReactTable({ setSearchBy, total, title, - data, + data = [], emptyMessage = "Sorry, no data found", footer = false, header = true, @@ -34,6 +34,7 @@ export default function ReactTable({ searchBy={searchBy} setSearchBy={setSearchBy} /> + {header === true && ( @@ -46,6 +47,7 @@ export default function ReactTable({ /> )} + {data.map((x) => { return ( @@ -63,6 +65,7 @@ export default function ReactTable({ ); })} + {data.length === 0 && ( )} + {footer === true && ( )} </table> + <Footer total={total} itemsPerPage={itemsPerPage}
@@ -71,6 +74,7 @@ export default function ReactTable({