Skip to content

Commit

Permalink
feat: code restructured as before
Browse files Browse the repository at this point in the history
  • Loading branch information
anishkumar-bhut committed Feb 29, 2024
1 parent 32b0339 commit b008613
Showing 1 changed file with 30 additions and 34 deletions.
64 changes: 30 additions & 34 deletions packages/react/src/components/Table/EmptyTable/EmptyTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,39 +57,6 @@ const EmptyTable = ({
testId,
emptyStateIcon,
}) => {
const isFilterEmptyTable = (
<EmptyState
icon="no-result"
title={messageWithFilters}
body={messageWithFiltersBody || ''}
action={
onEmptyStateAction
? {
label: buttonLabelWithFilters,
onClick: onEmptyStateAction,
kind: 'secondary',
}
: null
}
/>
);

const defaultEmptyTable = (
<EmptyState
icon={emptyStateIcon ?? 'empty'}
title={message}
body={messageBody || ''}
action={
onEmptyStateAction
? {
label: buttonLabel,
onClick: onEmptyStateAction,
}
: null
}
/>
);

return (
<TableBody
id={`${id}-empty-table`}
Expand All @@ -102,7 +69,36 @@ const EmptyTable = ({
emptyState
) : (
<div className="empty-table-cell--default">
{isFiltered ? isFilterEmptyTable : defaultEmptyTable}
{isFiltered ? (
<EmptyState
icon="no-result"
title={messageWithFilters}
body={messageWithFiltersBody || ''}
action={
onEmptyStateAction
? {
label: buttonLabelWithFilters,
onClick: onEmptyStateAction,
kind: 'secondary',
}
: null
}
/>
) : (
<EmptyState
icon={emptyStateIcon ?? 'empty'}

This comment has been minimized.

Copy link
@herleraja

herleraja Mar 18, 2024

Collaborator

This is breaking monitor code. The change should not break downstream application.
emptyStateIcon is by default empty or '' so '' ?? 'empty' always evaluated to ''

title={message || ''}
body={messageBody || ''}
action={
onEmptyStateAction
? {
label: buttonLabel,
onClick: onEmptyStateAction,
}
: null
}
/>
)}
</div>
)}
</TableCell>
Expand Down

0 comments on commit b008613

Please sign in to comment.