Skip to content

Commit

Permalink
Action feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
barrymcgee committed Jan 13, 2020
1 parent 8fb7b61 commit 748b20c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/components/MainTable/MainTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const generateRows = (
sortFunction
) => {
// If the table has no rows, return empty state message
if (Object.entries(rows).length === 0) {
if (Object.entries(rows).length === 0 && emptyStateMsg) {
return <caption>{emptyStateMsg}</caption>;
}
// Clone the rows so we can restore the original order.
Expand Down Expand Up @@ -148,7 +148,7 @@ const generateRows = (
const MainTable = ({
defaultSort,
defaultSortDirection,
emptyStateMsg = "No data to display",
emptyStateMsg = "",
expanding,
headers,
onUpdateSort,
Expand Down Expand Up @@ -229,7 +229,10 @@ const MainTable = ({
MainTable.propTypes = {
defaultSort: PropTypes.string,
defaultSortDirection: PropTypes.oneOf(["ascending", "descending"]),
emptyStateMsg: PropTypes.string,
/**
* A state that will be shown when no rows are passed to the table.
*/
emptyStateMsg: PropTypes.node,
expanding: PropTypes.bool,
headers: PropTypes.arrayOf(
PropTypes.shape({
Expand Down

0 comments on commit 748b20c

Please sign in to comment.