diff --git a/client/src/Pages/Notifications/components/ActionMenu.jsx b/client/src/Pages/Notifications/components/ActionMenu.jsx
deleted file mode 100644
index a3ccc4bbb..000000000
--- a/client/src/Pages/Notifications/components/ActionMenu.jsx
+++ /dev/null
@@ -1,83 +0,0 @@
-// Components
-import Menu from "@mui/material/Menu";
-import IconButton from "@mui/material/IconButton";
-import Icon from "@/Components/v1/Icon";
-import MenuItem from "@mui/material/MenuItem";
-
-// Utils
-import { useState } from "react";
-import { useTheme } from "@emotion/react";
-import { useNavigate } from "react-router-dom";
-import PropTypes from "prop-types";
-import { useTranslation } from "react-i18next";
-
-const ActionMenu = ({ notification, onDelete }) => {
- const theme = useTheme();
- const navigate = useNavigate();
- const [anchorEl, setAnchorEl] = useState(null);
- const open = Boolean(anchorEl);
- const { t } = useTranslation();
- // Handlers
- const handleClick = (event) => {
- event.stopPropagation();
- setAnchorEl(event.currentTarget);
- };
-
- const handleClose = (event) => {
- if (event) {
- event.stopPropagation();
- }
- setAnchorEl(null);
- };
-
- const handleRemove = (e) => {
- e.stopPropagation();
- onDelete(notification.id);
- handleClose();
- };
-
- const handleConfigure = (e) => {
- e.stopPropagation();
- navigate(`/notifications/${notification.id}`);
- handleClose();
- };
-
- return (
- <>
- e.stopPropagation()}
- >
-
-
-
-
- >
- );
-};
-
-ActionMenu.propTypes = {
- notification: PropTypes.object,
- onDelete: PropTypes.func,
-};
-
-export default ActionMenu;
diff --git a/client/src/Pages/Notifications/components/NotificationsTable.tsx b/client/src/Pages/Notifications/components/NotificationsTable.tsx
new file mode 100644
index 000000000..306d8efa8
--- /dev/null
+++ b/client/src/Pages/Notifications/components/NotificationsTable.tsx
@@ -0,0 +1,96 @@
+import { ActionsMenu, type ActionMenuItem } from "@/Components/v2/actions-menu";
+import Typography from "@mui/material/Typography";
+import type { Header } from "@/Components/v2/design-elements/Table";
+import { Table } from "@/Components/v2/design-elements";
+
+import type { Notification } from "@/Types/Notification";
+import { useNavigate } from "react-router";
+import { useTranslation } from "react-i18next";
+import { useTheme } from "@mui/material";
+
+interface NotificationsTableProps {
+ notifications: Notification[];
+ setSelectedChannel: Function;
+}
+
+export const NotificationsTable = ({
+ notifications,
+ setSelectedChannel,
+}: NotificationsTableProps) => {
+ const navigate = useNavigate();
+ const { t } = useTranslation();
+ const theme = useTheme();
+
+ const getActions = (channel: Notification): ActionMenuItem[] => {
+ return [
+ {
+ id: 1,
+ label: t("pages.common.monitors.actions.configure"),
+ action: () => {
+ navigate(`/notifications/${channel.id}`);
+ },
+ closeMenu: true,
+ },
+
+ {
+ id: 7,
+ label: (
+
+ {t("pages.common.monitors.actions.delete")}
+
+ ),
+ action: async () => {
+ setSelectedChannel(channel);
+ },
+ closeMenu: true,
+ },
+ ];
+ };
+
+ const getHeaders = () => {
+ const headers: Header[] = [
+ {
+ id: "name",
+ content: t("common.table.headers.name"),
+ render: (row) => {
+ return {row?.notificationName};
+ },
+ },
+
+ {
+ id: "type",
+ content: t("common.table.headers.type"),
+ render: (row) => {
+ return {row?.type};
+ },
+ },
+ {
+ id: "destination",
+ content: t("pages.notifications.table.headers.destination"),
+ render: (row) => {
+ return {row?.address};
+ },
+ },
+ {
+ id: "actions",
+ content: t("common.table.headers.actions"),
+ render: (row) => {
+ return ;
+ },
+ },
+ ];
+ return headers;
+ };
+
+ const headers = getHeaders();
+
+ return (
+ {
+ navigate(`/notifications/${row.id}`);
+ }}
+ />
+ );
+};
diff --git a/client/src/Pages/Notifications/index.jsx b/client/src/Pages/Notifications/index.jsx
deleted file mode 100644
index 70ed3ef96..000000000
--- a/client/src/Pages/Notifications/index.jsx
+++ /dev/null
@@ -1,121 +0,0 @@
-// Components
-import Stack from "@mui/material/Stack";
-import Typography from "@mui/material/Typography";
-import Breadcrumbs from "@/Components/v1/Breadcrumbs/index.jsx";
-import Button from "@mui/material/Button";
-import DataTable from "@/Components/v1/Table/index.jsx";
-import ActionMenu from "./components/ActionMenu.jsx";
-import PageStateWrapper from "@/Components/v1/PageStateWrapper/index.jsx";
-
-// Utils
-import { useState } from "react";
-import { useTheme } from "@emotion/react";
-import { useNavigate } from "react-router-dom";
-import {
- useGetNotificationsByTeamId,
- useDeleteNotification,
-} from "../../Hooks/useNotifications.js";
-import { useTranslation } from "react-i18next";
-
-const Notifications = () => {
- const navigate = useNavigate();
- const theme = useTheme();
- const BREADCRUMBS = [{ name: "notifications", path: "/notifications" }];
- const [updateTrigger, setUpdateTrigger] = useState(false);
- const [notifications, isLoading, error] = useGetNotificationsByTeamId(updateTrigger);
- const [deleteNotification, isDeleting, deleteError] = useDeleteNotification();
- const { t } = useTranslation();
- // Handlers
- const triggerUpdate = () => {
- setUpdateTrigger(!updateTrigger);
- };
-
- const onDelete = (id) => {
- deleteNotification(id, triggerUpdate);
- };
-
- const headers = [
- {
- id: "name",
- content: "Name",
- render: (row) => {
- return row.notificationName;
- },
- },
- {
- id: "target",
- content: "Target",
- render: (row) => {
- return row.address;
- },
- },
- {
- id: "platform",
- content: "Platform",
- render: (row) => {
- return row?.config?.platform || row.type;
- },
- },
-
- {
- id: "actions",
- content: "Actions",
- onClick: (e) => {
- e.stopPropagation();
- },
- render: (row) => {
- return (
-
- );
- },
- },
- ];
-
- return (
- <>
-
-
-
-
-
-
- {t("notifications.createTitle")}
- navigate(`/notifications/${row.id}`),
- rowSX: {
- cursor: "pointer",
- "&:hover td": {
- backgroundColor: theme.palette.tertiary.main,
- transition: "background-color .3s ease",
- },
- },
- }}
- headers={headers}
- data={notifications}
- />
-
-
- >
- );
-};
-
-export default Notifications;
diff --git a/client/src/Pages/Notifications/index.tsx b/client/src/Pages/Notifications/index.tsx
new file mode 100644
index 000000000..6e7dcc456
--- /dev/null
+++ b/client/src/Pages/Notifications/index.tsx
@@ -0,0 +1,65 @@
+import { BasePageWithStates } from "@/Components/v2/design-elements";
+import { NotificationsTable } from "@/Pages/Notifications/components/NotificationsTable";
+import { Dialog } from "@/Components/v2/inputs";
+
+import { useState } from "react";
+import { useGet, useDelete } from "@/Hooks/UseApi";
+import { useTranslation } from "react-i18next";
+import type { Notification } from "@/Types/Notification";
+
+const NotificationsPage = () => {
+ const { t } = useTranslation();
+
+ const [selectedChannel, setSelectedChannel] = useState(null);
+ const isDialogOpen = Boolean(selectedChannel);
+
+ const {
+ data: notifications,
+ isLoading,
+ isValidating,
+ error,
+ refetch,
+ } = useGet("/notifications/team", {}, { keepPreviousData: true });
+
+ const { deleteFn, loading: isDeleting } = useDelete();
+
+ const handleConfirm = async () => {
+ if (!selectedChannel) return;
+ await deleteFn(`/notifications/${selectedChannel.id}`);
+ setSelectedChannel(null);
+ refetch();
+ };
+
+ const handleCancel = () => {
+ setSelectedChannel(null);
+ };
+
+ return (
+
+
+
+
+ );
+};
+
+export default NotificationsPage;
diff --git a/client/src/Routes/index.jsx b/client/src/Routes/index.jsx
index f9b5cb8a1..e0725e8e2 100644
--- a/client/src/Routes/index.jsx
+++ b/client/src/Routes/index.jsx
@@ -43,7 +43,7 @@ import CreateStatus from "../Pages/StatusPage/Create/index.jsx";
import StatusPages from "../Pages/StatusPage/StatusPages/index.jsx";
import Status from "../Pages/StatusPage/Status/index.jsx";
-import Notifications from "../Pages/Notifications/index.jsx";
+import Notifications from "../Pages/Notifications";
import CreateNotifications from "../Pages/Notifications/create/index.jsx";
// Settings
@@ -210,7 +210,13 @@ const Routes = () => {
}
+ element={
+ <>
+
+
+
+ >
+ }
/>