This commit is contained in:
naterfute
2026-01-23 02:36:45 -08:00
parent bb8525086d
commit 8de44d803d

View File

@@ -90,8 +90,7 @@ const AllocationRow = ({ allocation }: Props) => {
};
const deleteAllocation = () => {
if (!confirm('Are you sure you want to delete this allocation?')) return;
setShowDeleteDialog(false);
clearFlashes();
setDeleteLoading(true);
@@ -202,7 +201,7 @@ const AllocationRow = ({ allocation }: Props) => {
<ActionButton
variant='danger'
size='sm'
onClick={deleteAllocation}
onClick={() => setShowDeleteDialog(true)}
disabled={allocation.isDefault || deleteLoading}
title={
allocation.isDefault ? 'Cannot delete the primary allocation' : 'Delete this allocation'
@@ -218,6 +217,15 @@ const AllocationRow = ({ allocation }: Props) => {
</Can>
</div>
</div>
<Dialog.Confirm
open={showDeleteDialog}
onClose={() => setShowDeleteDialog(false)}
title={'Delete Allocation'}
confirm={'Delete'}
onConfirmed={deleteAllocation}
>
Are you sure you want to delete this allocation? This action cannot be undone.
</Dialog.Confirm>
</PageListItem>
);
};