diff --git a/x-pack/plugins/observability/public/pages/alerts/alerts_table_t_grid.tsx b/x-pack/plugins/observability/public/pages/alerts/alerts_table_t_grid.tsx index 06252f3de05ced..afa6ba728b41f0 100644 --- a/x-pack/plugins/observability/public/pages/alerts/alerts_table_t_grid.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/alerts_table_t_grid.tsx @@ -75,7 +75,6 @@ interface AlertsTableTGridProps { } interface ObservabilityActionsProps extends ActionProps { - flyoutAlert: TopAlert | undefined; setFlyoutAlert: React.Dispatch>; } @@ -162,12 +161,10 @@ function ObservabilityActions({ data, eventId, ecsData, - flyoutAlert, setFlyoutAlert, }: ObservabilityActionsProps) { const { core, observabilityRuleTypeRegistry } = usePluginContext(); const dataFieldEs = data.reduce((acc, d) => ({ ...acc, [d.field]: d.value }), {}); - const handleFlyoutClose = () => setFlyoutAlert(undefined); const [openActionsPopoverId, setActionsPopover] = useState(null); const { timelines } = useKibana<{ timelines: TimelinesUIStart }>().services; const parseObservabilityAlert = useMemo(() => parseAlert(observabilityRuleTypeRegistry), [ @@ -223,15 +220,6 @@ function ObservabilityActions({ }, [afterCaseSelection, casePermissions, timelines, event]); return ( <> - {flyoutAlert && ( - - - - )} { - return ( - - ); + return ; }, }, ]; - }, [flyoutAlert]); + }, []); const tGridProps = useMemo(() => { const type: TGridType = 'standalone'; @@ -366,6 +348,21 @@ export function AlertsTableTGrid(props: AlertsTableTGridProps) { setRefetch, status, ]); + const handleFlyoutClose = () => setFlyoutAlert(undefined); + const { observabilityRuleTypeRegistry } = usePluginContext(); - return <>{timelines.getTGrid<'standalone'>(tGridProps)}; + return ( + <> + {flyoutAlert && ( + + + + )} + {timelines.getTGrid<'standalone'>(tGridProps)} + + ); }