@@ -3,7 +3,7 @@ import styled from '@emotion/styled';
33
44import NoAlertsImage from 'sentry-images/features/alerts-not-found.svg' ;
55
6- import { Button } from '@sentry/scraps/button' ;
6+ import { LinkButton } from '@sentry/scraps/button' ;
77import { Flex } from '@sentry/scraps/layout' ;
88import { Text } from '@sentry/scraps/text' ;
99
@@ -15,6 +15,7 @@ import {IconSearch} from 'sentry/icons';
1515import { t } from 'sentry/locale' ;
1616import type { Automation } from 'sentry/types/workflowEngine/automations' ;
1717import type { Sort } from 'sentry/utils/discover/fields' ;
18+ import { decodeScalar } from 'sentry/utils/queryString' ;
1819import { useLocation } from 'sentry/utils/useLocation' ;
1920import { useNavigate } from 'sentry/utils/useNavigate' ;
2021import { useOrganization } from 'sentry/utils/useOrganization' ;
@@ -24,6 +25,7 @@ import {
2425 AutomationListRowSkeleton ,
2526} from 'sentry/views/automations/components/automationListTable/row' ;
2627import { AUTOMATION_LIST_PAGE_LIMIT } from 'sentry/views/automations/constants' ;
28+ import { makeMonitorBasePathname } from 'sentry/views/detectors/pathnames' ;
2729
2830type AutomationListTableProps = {
2931 allResultsVisible : boolean ;
@@ -88,6 +90,7 @@ export function AutomationListTable({
8890 queryCount,
8991 allResultsVisible,
9092} : AutomationListTableProps ) {
93+ const location = useLocation ( ) ;
9194 const organization = useOrganization ( ) ;
9295 const canEditAutomations = hasEveryAccess ( [ 'alerts:write' ] , { organization} ) ;
9396
@@ -178,17 +181,27 @@ export function AutomationListTable({
178181 />
179182 ) }
180183 { isSuccess && automations . length === 0 && (
181- { /* TODO - pull this out so it's on it's own */ }
182184 < SimpleTable . Empty >
183- { /* TODO - Gap 16px, padding 56px */ }
184- < Flex direction = "column" align = "center" >
185+ < StyledFlex gap = "xl" direction = "column" align = "center" >
185186 < img src = { NoAlertsImage } />
186187 < Text as = "h5" > { t ( 'No alerts found.' ) } </ Text >
187- < Text > { t ( 'Looking for a monitor? Try looking on the monitors page' ) } </ Text >
188- < Button icon = { < IconSearch /> } priority = "primary" >
188+ < Text align = "center" variant = "muted" >
189+ { t ( 'Looking for a monitor? Try looking on the monitors page' ) }
190+ </ Text >
191+
192+ < LinkButton
193+ icon = { < IconSearch /> }
194+ priority = "primary"
195+ to = { {
196+ pathname : makeMonitorBasePathname ( organization . slug ) ,
197+ query : {
198+ query : decodeScalar ( location . query ?. query ) ,
199+ } ,
200+ } }
201+ >
189202 { t ( 'Search Monitors' ) }
190- </Button >
191- < / Flex >
203+ </ LinkButton >
204+ </ StyledFlex >
192205 </ SimpleTable . Empty >
193206 ) }
194207 { isError && < LoadingError message = { t ( 'Error loading alerts' ) } /> }
@@ -206,6 +219,10 @@ export function AutomationListTable({
206219 ) ;
207220}
208221
222+ const StyledFlex = styled ( Flex ) `
223+ padding: 56px;
224+ ` ;
225+
209226const AutomationsSimpleTable = styled ( SimpleTable ) `
210227 grid-template-columns: 1fr;
211228
0 commit comments