From 830387724195e30a34194d85c6afeeee27a8d3ef Mon Sep 17 00:00:00 2001 From: JORGE Date: Fri, 13 Dec 2024 15:25:17 -0400 Subject: [PATCH] [TM-1531] add connection for list the delayed jobs --- .../Notification/FloatNotification.tsx | 46 ++++++++------- src/connections/DelayedJob.ts | 57 +++++++++++++++++++ src/context/floatNotification.provider.tsx | 2 +- 3 files changed, 84 insertions(+), 21 deletions(-) create mode 100644 src/connections/DelayedJob.ts diff --git a/src/components/elements/Notification/FloatNotification.tsx b/src/components/elements/Notification/FloatNotification.tsx index 45e6e2af9..df7769950 100644 --- a/src/components/elements/Notification/FloatNotification.tsx +++ b/src/components/elements/Notification/FloatNotification.tsx @@ -1,10 +1,10 @@ import classNames from "classnames"; -import { useState } from "react"; +import { useEffect, useState } from "react"; import { When } from "react-if"; import Icon, { IconNames } from "@/components/extensive/Icon/Icon"; +import { useDelayedJobs } from "@/connections/DelayedJob"; -import LinearProgressBar from "../ProgressBar/LinearProgressBar/LinearProgressBar"; import Text from "../Text/Text"; export interface FloatNotificationDataProps { @@ -17,9 +17,13 @@ export interface FloatNotificationProps { data: FloatNotificationDataProps[]; } -const FloatNotification = ({ data }: FloatNotificationProps) => { +const FloatNotification = () => { const [openModalNotification, setOpenModalNotification] = useState(false); + const [isLoaded, { delayedJobs }] = useDelayedJobs(); + useEffect(() => { + console.log("delayedJobs", delayedJobs); + }, [isLoaded, delayedJobs]); return (
@@ -43,31 +47,33 @@ const FloatNotification = ({ data }: FloatNotificationProps) => {
- {data.map((item, index) => ( -
-
-
- - {item.label} - -
- + {isLoaded && + delayedJobs && + delayedJobs.map((item, index) => ( +
+
+
+ + {item.processedContent} + +
+ {/* Site: {item.site} - -
+ */} + {/*
{item.value} +
*/}
-
- ))} + ))}
- 0}> + 0}>
- {data.length} + {delayedJobs?.length}