{filters || resolvedActions ? (
) : null}
{!error && (
{bulkActionButtons && children && React.isValidElement(children)
? cloneElement(children, { bulkActionButtons })
: children}
)}
{error ? (
) : (
pagination !== false && pagination
)}
);
}
function renderEmpty() {
return empty !== false && cloneElement(empty, { className: ListClasses.noResults, hasCreate });
}
const shouldRenderEmptyList = !isLoading && data?.length === 0;
const shouldRenderEmptyPage =
!isLoading && data?.length === 0 && !Object.keys(filterValues).length && empty !== false;
// Check if 'aside' is a valid React element
const isAsideValid = React.isValidElement(aside);
// Determine if 'aside' is a FilterSidebar component
const isFilterSidebar = isAsideValid && aside?.type === FilterSidebar;
// Use React.Fragment if there's a generic 'aside', otherwise use MainCard
const Wrapper = isLoading || shouldRenderEmptyPage || (isAsideValid && !isFilterSidebar) ? React.Fragment : MainCard;
// Define props for the ListWrapper based on the presence of 'aside'
const wrapperProps =
!isLoading && !shouldRenderEmptyPage && (!aside || isFilterSidebar) ? { content: false } : undefined;
return (