File tree 2 files changed +7
-2
lines changed
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({
18
18
setSearchBy,
19
19
total,
20
20
title,
21
- data,
21
+ data = [ ] ,
22
22
emptyMessage = "Sorry, no data found" ,
23
23
footer = false ,
24
24
header = true ,
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export default function ReactTable({
17
17
setSearchBy,
18
18
total,
19
19
title,
20
- data,
20
+ data = [ ] ,
21
21
emptyMessage = "Sorry, no data found" ,
22
22
footer = false ,
23
23
header = true ,
@@ -34,6 +34,7 @@ export default function ReactTable({
34
34
searchBy = { searchBy }
35
35
setSearchBy = { setSearchBy }
36
36
/>
37
+
37
38
< table { ...props } className = "w-full" >
38
39
{ header === true && (
39
40
< thead className = "bg-slate-200" >
@@ -46,6 +47,7 @@ export default function ReactTable({
46
47
/>
47
48
</ thead >
48
49
) }
50
+
49
51
< tbody >
50
52
{ data . map ( ( x ) => {
51
53
return (
@@ -63,6 +65,7 @@ export default function ReactTable({
63
65
</ tr >
64
66
) ;
65
67
} ) }
68
+
66
69
{ data . length === 0 && (
67
70
< tr >
68
71
< td className = "bg-slate-50 px-2" colSpan = { title . length } >
@@ -71,6 +74,7 @@ export default function ReactTable({
71
74
</ tr >
72
75
) }
73
76
</ tbody >
77
+
74
78
{ footer === true && (
75
79
< tfoot className = "bg-slate-200" >
76
80
< Title
@@ -83,6 +87,7 @@ export default function ReactTable({
83
87
</ tfoot >
84
88
) }
85
89
</ table >
90
+
86
91
< Footer
87
92
total = { total }
88
93
itemsPerPage = { itemsPerPage }
You can’t perform that action at this time.
0 commit comments