fix empty state

This commit is contained in:
Alex Holliday committed 2026-02-05 18:56:54 +00:00
1 parent 6e66a18535
commit 0e149fa477
2 files changed
+23 -2

No files matched your search

@@ -99,6 +99,15 @@ const InfrastructureMonitors = () => {
const { summary, count } = monitorsWithChecksData ?? {};
const isLoading = monitorsWithChecksLoading;
// Check if any filters are active
const hasActiveFilters = Boolean(selectedStatus || selectedState || search);
// Show empty state only when there are truly no monitors (not just filtered out)
const effectiveTotalCount =
hasActiveFilters && (summary?.totalMonitors ?? 0) === 0
? 1
: (summary?.totalMonitors ?? 0);
// Delete hook
const { deleteFn, loading: isDeleting } = useDelete();
@@ -117,7 +126,7 @@ const InfrastructureMonitors = () => {
<MonitorBasePageWithStates
loading={isLoading}
error={monitorsWithChecksError}
totalCount={summary?.totalMonitors ?? 0}
totalCount={effectiveTotalCount}
page="infrastructure"
actionLink="/infrastructure/create"
>