diff --git a/apps/dokploy/components/dashboard/settings/notifications/show-notifications.tsx b/apps/dokploy/components/dashboard/settings/notifications/show-notifications.tsx index fe31acc4c..866ed38ee 100644 --- a/apps/dokploy/components/dashboard/settings/notifications/show-notifications.tsx +++ b/apps/dokploy/components/dashboard/settings/notifications/show-notifications.tsx @@ -1,152 +1,164 @@ -import { Bell, Loader2, Mail, MessageCircleMore, Trash2 } from "lucide-react"; +import { + Bell, + Loader2, + Mail, + MessageCircleMore, + PenBoxIcon, + Trash2, +} from "lucide-react"; import { toast } from "sonner"; import { - DiscordIcon, - SlackIcon, - TelegramIcon, + DiscordIcon, + SlackIcon, + TelegramIcon, } from "@/components/icons/notification-icons"; import { DialogAction } from "@/components/shared/dialog-action"; import { Button } from "@/components/ui/button"; import { - Card, - CardContent, - CardDescription, - CardHeader, - CardTitle, + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, } from "@/components/ui/card"; import { api } from "@/utils/api"; import { HandleNotifications } from "./handle-notifications"; export const ShowNotifications = () => { - const { data, isLoading, refetch } = api.notification.all.useQuery(); - const { mutateAsync, isLoading: isRemoving } = - api.notification.remove.useMutation(); + const { data, isLoading, refetch } = api.notification.all.useQuery(); + const { mutateAsync, isLoading: isRemoving } = + api.notification.remove.useMutation(); - return ( -
- -
- - - - Notifications - - - Add your providers to receive notifications, like Discord, Slack, - Telegram, Email. - - - - {isLoading ? ( -
- Loading... - -
- ) : ( - <> - {data?.length === 0 ? ( -
- - - To send notifications it is required to set at least 1 - provider. - - -
- ) : ( -
-
- {data?.map((notification, _index) => ( -
-
- - {notification.notificationType === "slack" && ( -
- -
- )} - {notification.notificationType === "telegram" && ( -
- -
- )} - {notification.notificationType === "discord" && ( -
- -
- )} - {notification.notificationType === "email" && ( -
- -
- )} - {notification.notificationType === "gotify" && ( -
- -
- )} - {notification.notificationType === "ntfy" && ( -
- -
- )} + return ( +
+ +
+ + + + Notifications + + + Add your providers to receive notifications, like Discord, Slack, + Telegram, Email. + + + + {isLoading ? ( +
+ Loading... + +
+ ) : ( + <> + {data?.length === 0 ? ( +
+ + + To send notifications it is required to set at least 1 + provider. + + +
+ ) : ( +
+
+ {data?.map((notification, _index) => ( +
+
+ + {notification.notificationType === "slack" && ( +
+ +
+ )} + {notification.notificationType === "telegram" && ( +
+ +
+ )} + {notification.notificationType === "discord" && ( +
+ +
+ )} + {notification.notificationType === "email" && ( +
+ +
+ )} + {notification.notificationType === "gotify" && ( +
+ +
+ )} + {notification.notificationType === "ntfy" && ( +
+ +
+ )} + {notification.notificationType === "custom" && ( +
+ +
+ )} - {notification.name} -
-
- + {notification.name} + +
+ - { - await mutateAsync({ - notificationId: notification.notificationId, - }) - .then(() => { - toast.success( - "Notification deleted successfully", - ); - refetch(); - }) - .catch(() => { - toast.error( - "Error deleting notification", - ); - }); - }} - > - - -
-
-
- ))} -
+ { + await mutateAsync({ + notificationId: notification.notificationId, + }) + .then(() => { + toast.success( + "Notification deleted successfully" + ); + refetch(); + }) + .catch(() => { + toast.error( + "Error deleting notification" + ); + }); + }} + > + + +
+
+
+ ))} +
-
- -
-
- )} - - )} - -
- -
- ); +
+ +
+
+ )} + + )} +
+
+
+
+ ); };