diff --git a/static/gsApp/views/seerAutomation/components/projectTable/seerProjectTable.tsx b/static/gsApp/views/seerAutomation/components/projectTable/seerProjectTable.tsx
index 0cb831b1674f..75fe6b0cc8a5 100644
--- a/static/gsApp/views/seerAutomation/components/projectTable/seerProjectTable.tsx
+++ b/static/gsApp/views/seerAutomation/components/projectTable/seerProjectTable.tsx
@@ -18,9 +18,7 @@ import {SimpleTable} from 'sentry/components/tables/simpleTable';
import {IconSearch} from 'sentry/icons/iconSearch';
import {t, tct} from 'sentry/locale';
import {ProjectsStore} from 'sentry/stores/projectsStore';
-import type {Project} from 'sentry/types/project';
import {useFetchAllPages} from 'sentry/utils/api/apiFetch';
-import type {Sort} from 'sentry/utils/discover/fields';
import {ListItemCheckboxProvider} from 'sentry/utils/list/useListItemCheckboxState';
import {useInfiniteQuery, useQuery, useQueryClient} from 'sentry/utils/queryClient';
import type {ApiQueryKey} from 'sentry/utils/queryClient';
@@ -193,166 +191,89 @@ export function SeerProjectTable() {
return filtered;
}, [sortedProjects, searchTerm, agentFilter, autofixSettingsByProjectId]);
- if (fetching) {
- return (
-
-
-
-
-
- );
- }
-
- if (fetchError) {
- return (
-
-
-
-
-
- );
- }
-
return (
project.id)}
queryKey={queryKey}
>
-
- {filteredProjects.length === 0 ? (
-
- {searchTerm
- ? agentFilter
- ? tct('No projects found matching [searchTerm] with [agentFilter]', {
- searchTerm: {searchTerm},
- agentFilter: {getFilteredCodingAgentName(agentFilter)},
- })
- : tct('No projects found matching [searchTerm]', {
- searchTerm: {searchTerm},
- })
- : agentFilter
- ? tct('No projects found with [agentFilter]', {
- agentFilter: {getFilteredCodingAgentName(agentFilter)},
- })
- : t('No projects found')}
-
- ) : (
- filteredProjects.map(project => (
-
+
+ {codingAgentCompactSelectOptions.data?.length ? (
+
+ trigger={triggerProps => (
+
+ {agentFilter ? triggerProps.children : t('All')}
+
+ )}
+ options={codingAgentCompactSelectOptions.data ?? []}
+ onChange={option => setAgentFilter(option.value || null)}
+ value={agentFilter ?? ''}
/>
- ))
- )}
-
-
- );
-}
+ ) : null}
-function ProjectTable({
- agentFilter,
- codingAgentCompactSelectOptions,
- children,
- onSortClick,
- projects,
- searchTerm,
- setAgentFilter,
- setSearchTerm,
- sort,
- updateBulkAutofixAutomationSettings,
-}: {
- agentFilter: null | PreferredAgentProvider;
- children: React.ReactNode;
- codingAgentCompactSelectOptions: Array<{
- label: React.ReactNode;
- value: '' | PreferredAgentProvider;
- }>;
- onSortClick: (sort: Sort) => void;
- projects: Project[];
- searchTerm: string;
- setAgentFilter: ReturnType>[1];
- setSearchTerm: ReturnType>[1];
- sort: Sort;
- updateBulkAutofixAutomationSettings: ReturnType<
- typeof useUpdateBulkAutofixAutomationSettings
- >['mutate'];
-}) {
- return (
-
-
- {codingAgentCompactSelectOptions.length ? (
-
- trigger={triggerProps => (
-
- {agentFilter ? triggerProps.children : t('All')}
-
- )}
- options={codingAgentCompactSelectOptions}
- onChange={option => setAgentFilter(option.value || null)}
- value={agentFilter ?? ''}
- />
- ) : null}
-
-
-
-
-
-
- setSearchTerm(e.target.value, {limitUrlUpdates: debounce(125)})
- }
+
+
+
+
+
+ setSearchTerm(e.target.value, {limitUrlUpdates: debounce(125)})
+ }
+ />
+
+
+
+
-
-
-
-
- {children}
-
-
+ {fetching ? (
+
+
+
+ ) : fetchError ? (
+
+
+
+ ) : filteredProjects.length === 0 ? (
+
+ {searchTerm
+ ? agentFilter
+ ? tct('No projects found matching [searchTerm] with [agentFilter]', {
+ searchTerm: {searchTerm},
+ agentFilter: {getFilteredCodingAgentName(agentFilter)},
+ })
+ : tct('No projects found matching [searchTerm]', {
+ searchTerm: {searchTerm},
+ })
+ : agentFilter
+ ? tct('No projects found with [agentFilter]', {
+ agentFilter: {getFilteredCodingAgentName(agentFilter)},
+ })
+ : t('No projects found')}
+
+ ) : (
+ filteredProjects.map(project => (
+
+ ))
+ )}
+
+
+
);
}