show activity indicator on trash icon while deleting a profile

This commit is contained in:
Josh Hawkins 2026-03-12 10:47:05 -05:00
parent af0696771a
commit 8d633423b0

View File

@ -510,12 +510,17 @@ export default function ProfilesView({
variant="ghost" variant="ghost"
size="icon" size="icon"
className="size-7 text-muted-foreground hover:text-destructive" className="size-7 text-muted-foreground hover:text-destructive"
disabled={deleting && deleteProfile === profile}
onClick={(e) => { onClick={(e) => {
e.stopPropagation(); e.stopPropagation();
setDeleteProfile(profile); setDeleteProfile(profile);
}} }}
> >
<Trash2 className="size-4" /> {deleting && deleteProfile === profile ? (
<ActivityIndicator className="size-4" />
) : (
<Trash2 className="size-4" />
)}
</Button> </Button>
</div> </div>
</div> </div>
@ -650,7 +655,10 @@ export default function ProfilesView({
</AlertDialogCancel> </AlertDialogCancel>
<AlertDialogAction <AlertDialogAction
className="bg-destructive text-white hover:bg-destructive/90" className="bg-destructive text-white hover:bg-destructive/90"
onClick={handleDeleteProfile} onClick={(e) => {
e.preventDefault();
handleDeleteProfile();
}}
disabled={deleting} disabled={deleting}
> >
{deleting && <ActivityIndicator className="mr-2 size-4" />} {deleting && <ActivityIndicator className="mr-2 size-4" />}