Showing 13 of 13 total issues
Similar blocks of code found in 3 locations. Consider refactoring. Open
<div className="space-y-2"> <Label className="text-sm font-medium"> {t("select_new_role")} </Label> <Select value={selectedRole} onValueChange={setSelectedRole}>
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
<AlertDialog> <AlertDialogTrigger asChild> <Button variant="destructive" className="w-full"> {t("remove_user")} </Button>
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
<div className="flex items-start gap-4"> <Avatar name={`${userRole.user.first_name} ${userRole.user.last_name}`} className="size-12" imageUrl={userRole.user.profile_picture_url}
- Read upRead up
- Create a ticketCreate a ticket
Identical blocks of code found in 5 locations. Consider refactoring. Open
onError: (error) => { const errorData = error.cause as { errors: { msg: string[] } }; errorData.errors.msg.forEach((er) => { toast.error(er); });
- Read upRead up
- Create a ticketCreate a ticket
Identical blocks of code found in 5 locations. Consider refactoring. Open
onError: (error) => { const errorData = error.cause as { errors: { msg: string[] } }; errorData.errors.msg.forEach((er) => { toast.error(er); });
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
const handleUpdateRole = () => { if (selectedRole === userRole.role.id) { toast.error(t("select_diff_role")); return; }
- Read upRead up
- Create a ticketCreate a ticket
Identical blocks of code found in 2 locations. Consider refactoring. Open
<div> <span className="text-sm text-gray-500"> {t("current_role")} </span> <p className="text-sm font-medium">{userRole.role.name}</p>
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 14 locations. Consider refactoring. Open
<SheetHeader> <SheetTitle>{t("edit_user_role")}</SheetTitle> <SheetDescription> {t("update_user_role_organization")} </SheetDescription>
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
onSuccess: () => { queryClient.invalidateQueries({ queryKey: ["organizationUsers", organizationId], }); toast.success(t("user_role_update_success"));
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
onSuccess: () => { queryClient.invalidateQueries({ queryKey: ["organizationUsers", organizationId], }); toast.success(t("user_removed_success"));
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
<Button className="w-full" onClick={handleUpdateRole} disabled={selectedRole === userRole.role.id} >
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
<div className="col-span-2"> <span className="text-sm text-gray-500"> {t("last_login")}{" "} </span> <UserStatusIndicator user={userRole.user} />
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
<SheetTrigger asChild> {trigger || <Button variant="outline">{t("edit_role")}</Button>} </SheetTrigger>
- Read upRead up
- Create a ticketCreate a ticket