diff --git a/langflow/frontend/src/alerts/error/index.tsx b/langflow/frontend/src/alerts/error/index.tsx index 65a582be5..94e71a98e 100644 --- a/langflow/frontend/src/alerts/error/index.tsx +++ b/langflow/frontend/src/alerts/error/index.tsx @@ -1,64 +1,66 @@ import { Transition } from "@headlessui/react"; import { XCircleIcon, XMarkIcon } from "@heroicons/react/24/outline"; import { useEffect, useState } from "react"; -import { ErrorAlertType} from "../../types/alerts"; +import { ErrorAlertType } from "../../types/alerts"; -export default function ErrorAlert({ title, list = [], id, removeAlert }:ErrorAlertType) { - const [show, setShow] = useState(true); - useEffect(() => { - if(show){ - setTimeout(() => { - setShow(false); setTimeout(() => {removeAlert(id);}, 500); - }, 5000); - } - }, [id, removeAlert, show]); - return ( - -
-
-
-
-
-

{title}

- {list.length !== 0 - ? -
-
    - {list.map((item, index) => ( -
  • {item}
  • - ))} -
-
- : - <> - } - -
-
-
- -
-
-
-
-
- ); +export default function ErrorAlert({ + title, + list = [], + id, + removeAlert, +}: ErrorAlertType) { + const [show, setShow] = useState(true); + useEffect(() => { + if (show) { + setTimeout(() => { + setShow(false); + setTimeout(() => { + removeAlert(id); + }, 500); + }, 5000); + } + }, [id, removeAlert, show]); + return ( + +
{ + setShow(false); + setTimeout(() => { + removeAlert(id); + }, 500); + }} + className="rounded-md w-96 mt-6 shadow-xl bg-red-50 p-4 cursor-pointer" + > +
+
+
+
+

{title}

+ {list.length !== 0 ? ( +
+
    + {list.map((item, index) => ( +
  • {item}
  • + ))} +
+
+ ) : ( + <> + )} +
+
+
+
+ ); } diff --git a/langflow/frontend/src/alerts/notice/index.tsx b/langflow/frontend/src/alerts/notice/index.tsx index 86e55c8e4..3c5095339 100644 --- a/langflow/frontend/src/alerts/notice/index.tsx +++ b/langflow/frontend/src/alerts/notice/index.tsx @@ -4,63 +4,64 @@ import { useEffect, useState } from "react"; import { Link } from "react-router-dom"; import { NoticeAlertType } from "../../types/alerts"; -export default function NoticeAlert({ title, link = "", id, removeAlert }:NoticeAlertType) { - const [show, setShow] = useState(true); - useEffect(() => { - if(show){ - setTimeout(() => { - setShow(false); setTimeout(() => {removeAlert(id);}, 500); - }, 5000); - } - }, [id, removeAlert, show]); - return ( - -
-
-
-
-
-

{title}

-

- {link !== "" - ? - - Details - - : - <> - } -

-
-
-
- -
-
-
-
-
- ); +export default function NoticeAlert({ + title, + link = "", + id, + removeAlert, +}: NoticeAlertType) { + const [show, setShow] = useState(true); + useEffect(() => { + if (show) { + setTimeout(() => { + setShow(false); + setTimeout(() => { + removeAlert(id); + }, 500); + }, 5000); + } + }, [id, removeAlert, show]); + return ( + +
{ + setShow(false); + removeAlert(id); + }} + className="rounded-md w-96 mt-6 shadow-xl bg-blue-50 p-4" + > +
+
+
+
+

{title}

+

+ {link !== "" ? ( + + Details + + ) : ( + <> + )} +

+
+
+
+
+ ); } diff --git a/langflow/frontend/src/alerts/success/index.tsx b/langflow/frontend/src/alerts/success/index.tsx index 07659c19e..80b98b05d 100644 --- a/langflow/frontend/src/alerts/success/index.tsx +++ b/langflow/frontend/src/alerts/success/index.tsx @@ -3,50 +3,51 @@ import { CheckCircleIcon, XMarkIcon } from "@heroicons/react/24/outline"; import { useEffect, useState } from "react"; import { SuccessAlertType } from "../../types/alerts"; -export default function SuccessAlert({ title, id, removeAlert }:SuccessAlertType) { - const [show, setShow] = useState(true); - useEffect(() => { - if(show){ - setTimeout(() => { - setShow(false); setTimeout(() => {removeAlert(id);}, 500); - }, 5000); - } - }, [id, removeAlert, show]); - return ( - -
-
-
-
-
-

{title}

-
-
-
- -
-
-
-
-
- ); +export default function SuccessAlert({ + title, + id, + removeAlert, +}: SuccessAlertType) { + const [show, setShow] = useState(true); + useEffect(() => { + if (show) { + setTimeout(() => { + setShow(false); + setTimeout(() => { + removeAlert(id); + }, 500); + }, 5000); + } + }, [id, removeAlert, show]); + return ( + +
{ + setShow(false); + removeAlert(id); + }} + className="rounded-md w-96 mt-6 shadow-xl bg-green-50 p-4" + > +
+
+
+
+

{title}

+
+
+
+
+ ); }