@@ -8,6 +8,7 @@ import { formatDuration } from "@flanksource-ui/utils/date";
88import { atom , useAtom } from "jotai" ;
99import { MRT_ColumnDef } from "mantine-react-table" ;
1010import { useState } from "react" ;
11+ import { createPortal } from "react-dom" ;
1112import { FaExclamationTriangle } from "react-icons/fa" ;
1213import { Tooltip } from "react-tooltip" ;
1314import JobHistoryStatusColumn from "../../JobsHistory/JobHistoryStatusColumn" ;
@@ -193,7 +194,6 @@ export const notificationsRulesTableColumns: MRT_ColumnDef<NotificationRules>[]
193194 < >
194195 < span
195196 data-tooltip-id = { `error-tooltip-${ row . original . id } ` }
196- data-tooltip-content = { error }
197197 onClick = { ( e ) => {
198198 e . stopPropagation ( ) ;
199199 e . preventDefault ( ) ;
@@ -202,7 +202,15 @@ export const notificationsRulesTableColumns: MRT_ColumnDef<NotificationRules>[]
202202 >
203203 < FaExclamationTriangle className = "mr-1 inline h-4 w-4 text-red-500" />
204204 </ span >
205- < Tooltip id = { `error-tooltip-${ row . original . id } ` } />
205+ { createPortal (
206+ < Tooltip
207+ className = "z-[9999999999]"
208+ id = { `error-tooltip-${ row . original . id } ` }
209+ >
210+ < pre className = "whitespace-pre-wrap text-sm" > { error } </ pre >
211+ </ Tooltip > ,
212+ document . body
213+ ) }
206214
207215 < Modal
208216 open = { showError }
@@ -259,11 +267,7 @@ export const notificationsRulesTableColumns: MRT_ColumnDef<NotificationRules>[]
259267 return (
260268 < >
261269 < div
262- className = "z-[99999999] w-full"
263270 data-tooltip-id = "most-common-error-tooltip"
264- data-tooltip-content = {
265- value > 0 ? notification . most_common_error : undefined
266- }
267271 onClick = { ( e ) => {
268272 if ( notification . most_common_error ) {
269273 e . stopPropagation ( ) ;
@@ -273,7 +277,18 @@ export const notificationsRulesTableColumns: MRT_ColumnDef<NotificationRules>[]
273277 >
274278 { value }
275279 </ div >
276- { value > 0 && < Tooltip id = "most-common-error-tooltip" /> }
280+ { value > 0 &&
281+ createPortal (
282+ < Tooltip
283+ id = "most-common-error-tooltip"
284+ className = "z-[9999999999] max-w-[95vw]"
285+ >
286+ < pre className = "whitespace-pre-wrap text-sm" >
287+ { notification . most_common_error }
288+ </ pre >
289+ </ Tooltip > ,
290+ document . body
291+ ) }
277292 </ >
278293 ) ;
279294 }
0 commit comments