@@ -5,20 +5,15 @@ import {Flex} from '@sentry/scraps/layout';
55
66import { hasEveryAccess } from 'sentry/components/acl/access' ;
77import { Placeholder } from 'sentry/components/placeholder' ;
8- import { ProjectList } from 'sentry/components/projectList' ;
98import { SimpleTable } from 'sentry/components/tables/simpleTable' ;
109import { ActionCell } from 'sentry/components/workflowEngine/gridCell/actionCell' ;
1110import { AutomationTitleCell } from 'sentry/components/workflowEngine/gridCell/automationTitleCell' ;
12- import { EmptyCell } from 'sentry/components/workflowEngine/gridCell/emptyCell' ;
1311import { TimeAgoCell } from 'sentry/components/workflowEngine/gridCell/timeAgoCell' ;
14- import { ProjectsStore } from 'sentry/stores/projectsStore' ;
1512import type { Automation } from 'sentry/types/workflowEngine/automations' ;
1613import { useOrganization } from 'sentry/utils/useOrganization' ;
1714import { AutomationListConnectedDetectors } from 'sentry/views/automations/components/automationListTable/connectedDetectors' ;
18- import {
19- getAutomationActions ,
20- useAutomationProjectIds ,
21- } from 'sentry/views/automations/hooks/utils' ;
15+ import { ProjectsCell } from 'sentry/views/automations/components/automationListTable/projectsCell' ;
16+ import { getAutomationActions } from 'sentry/views/automations/hooks/utils' ;
2217
2318type AutomationListRowProps = {
2419 automation : Automation ;
@@ -36,10 +31,6 @@ export function AutomationListRow({
3631
3732 const actions = getAutomationActions ( automation ) ;
3833 const { enabled, lastTriggered, detectorIds = [ ] } = automation ;
39- const { projectIds, isLoading : isProjectsLoading } = useAutomationProjectIds ( automation ) ;
40- const projectSlugs = projectIds . map (
41- projectId => ProjectsStore . getById ( projectId ) ?. slug
42- ) as string [ ] ;
4334
4435 return (
4536 < AutomationSimpleTableRow
@@ -67,13 +58,7 @@ export function AutomationListRow({
6758 < ActionCell actions = { actions } disabled = { ! enabled } />
6859 </ SimpleTable . RowCell >
6960 < SimpleTable . RowCell data-column-name = "projects" >
70- { isProjectsLoading ? (
71- < Placeholder height = "20px" />
72- ) : projectSlugs . length > 0 ? (
73- < ProjectList projectSlugs = { projectSlugs } />
74- ) : (
75- < EmptyCell />
76- ) }
61+ < ProjectsCell automation = { automation } />
7762 </ SimpleTable . RowCell >
7863 < SimpleTable . RowCell data-column-name = "connected-monitors" >
7964 < AutomationListConnectedDetectors detectorIds = { detectorIds } />
0 commit comments