import { Trans, useTranslation } from "react-i18next"; import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "@/components/ui/dialog"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { useState } from "react"; import { LuShield, LuUser } from "react-icons/lu"; type RoleChangeDialogProps = { show: boolean; username: string; currentRole: string; availableRoles: string[]; onSave: (role: string) => void; onCancel: () => void; }; export default function RoleChangeDialog({ show, username, currentRole, availableRoles, onSave, onCancel, }: RoleChangeDialogProps) { const { t } = useTranslation(["views/settings"]); const [selectedRole, setSelectedRole] = useState(currentRole); return ( {t("users.dialog.changeRole.title")} , }} />

{t("users.dialog.changeRole.roleInfo.intro")}

  • {t("users.dialog.changeRole.roleInfo.admin")} : {t("users.dialog.changeRole.roleInfo.adminDesc")}
  • {t("users.dialog.changeRole.roleInfo.viewer")} : {t("users.dialog.changeRole.roleInfo.viewerDesc")}
  • {availableRoles .filter((role) => role !== "admin" && role !== "viewer") .map((role) => (
  • {role}:{" "} {t("users.dialog.changeRole.roleInfo.customDesc")}
  • ))}
); }