File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ export default function ReactTable({
1818 setSearchBy,
1919 total,
2020 title,
21- data,
21+ data = [ ] ,
2222 emptyMessage = "Sorry, no data found" ,
2323 footer = false ,
2424 header = true ,
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export default function ReactTable({
1717 setSearchBy,
1818 total,
1919 title,
20- data,
20+ data = [ ] ,
2121 emptyMessage = "Sorry, no data found" ,
2222 footer = false ,
2323 header = true ,
@@ -34,6 +34,7 @@ export default function ReactTable({
3434 searchBy = { searchBy }
3535 setSearchBy = { setSearchBy }
3636 />
37+
3738 < table { ...props } className = "w-full" >
3839 { header === true && (
3940 < thead className = "bg-slate-200" >
@@ -46,6 +47,7 @@ export default function ReactTable({
4647 />
4748 </ thead >
4849 ) }
50+
4951 < tbody >
5052 { data . map ( ( x ) => {
5153 return (
@@ -63,6 +65,7 @@ export default function ReactTable({
6365 </ tr >
6466 ) ;
6567 } ) }
68+
6669 { data . length === 0 && (
6770 < tr >
6871 < td className = "bg-slate-50 px-2" colSpan = { title . length } >
@@ -71,6 +74,7 @@ export default function ReactTable({
7174 </ tr >
7275 ) }
7376 </ tbody >
77+
7478 { footer === true && (
7579 < tfoot className = "bg-slate-200" >
7680 < Title
@@ -83,6 +87,7 @@ export default function ReactTable({
8387 </ tfoot >
8488 ) }
8589 </ table >
90+
8691 < Footer
8792 total = { total }
8893 itemsPerPage = { itemsPerPage }
You can’t perform that action at this time.
0 commit comments