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 + +

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