From bf412cf752c2ee59486ef156aa7f4098c245dfb2 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Thu, 11 Sep 2025 08:48:29 -0500 Subject: [PATCH] delete role dialog --- .../components/overlay/DeleteRoleDialog.tsx | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 web/src/components/overlay/DeleteRoleDialog.tsx diff --git a/web/src/components/overlay/DeleteRoleDialog.tsx b/web/src/components/overlay/DeleteRoleDialog.tsx new file mode 100644 index 000000000..09380e161 --- /dev/null +++ b/web/src/components/overlay/DeleteRoleDialog.tsx @@ -0,0 +1,109 @@ +import { Button } from "@/components/ui/button"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle, +} from "@/components/ui/dialog"; +import { Trans } from "react-i18next"; +import { useTranslation } from "react-i18next"; +import ActivityIndicator from "@/components/indicators/activity-indicator"; +import { useState } from "react"; + +type DeleteRoleDialogProps = { + show: boolean; + role: string; + onCancel: () => void; + onDelete: () => void; +}; + +export default function DeleteRoleDialog({ + show, + role, + onCancel, + onDelete, +}: DeleteRoleDialogProps) { + const { t } = useTranslation("views/settings"); + const [isLoading, setIsLoading] = useState(false); + + const handleDelete = async () => { + setIsLoading(true); + try { + await onDelete(); + } catch (error) { + // Error handled in parent + } finally { + setIsLoading(false); + } + }; + + return ( + + + + {t("roles.dialog.deleteRole.title")} + + , + }} + /> + + + +
+
+

+ }} + > + roles.dialog.deleteRole.warn + +

+
+
+ + +
+
+ + +
+
+
+
+
+ ); +}