File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -28,10 +28,17 @@ function MembersTable({ rows: allRows, onRowClick }) {
2828 allRows
2929 )
3030
31+ let emptyTableMessage = 'This team has no members.'
32+
3133 if ( search ) {
3234 rows = rows . filter ( ( r ) =>
3335 r . name . toUpperCase ( ) . includes ( search . toUpperCase ( ) )
3436 )
37+
38+ // Change empty table message when no results are available
39+ if ( rows . length === 0 ) {
40+ emptyTableMessage = 'Search returned no results.'
41+ }
3542 }
3643
3744 // Calculate start and end index
@@ -53,7 +60,7 @@ function MembersTable({ rows: allRows, onRowClick }) {
5360 data-cy = 'team-members-table'
5461 rows = { rows . slice ( pageStartIndex , pageEndIndex ) }
5562 columns = { columns }
56- emptyPlaceHolder = 'This team has no members.'
63+ emptyPlaceHolder = { emptyTableMessage }
5764 onRowClick = { onRowClick }
5865 showRowNumbers
5966 sort = { sort }
@@ -65,7 +72,7 @@ function MembersTable({ rows: allRows, onRowClick }) {
6572 total : rows . length ,
6673 currentPage : page ,
6774 } }
68- data-cy = { ` team-members-table-pagination` }
75+ data-cy = ' team-members-table-pagination'
6976 setPage = { setPage }
7077 />
7178 </ >
You can’t perform that action at this time.
0 commit comments