feat: add onClose functionality to ApprovalCard across all HITL tools

This commit is contained in:
Anish Sarkar 2026-03-20 23:50:50 +05:30
parent 85462675a0
commit ab6eeaf02e
11 changed files with 36 additions and 6 deletions

View file

@ -259,6 +259,7 @@ function ApprovalCard({
setIsPanelOpen(false);
setPendingEdits({ title: newTitle, description: newDescription });
},
onClose: () => setIsPanelOpen(false),
});
}}
>
@ -488,7 +489,7 @@ function ApprovalCard({
size="sm"
className="rounded-lg gap-1.5"
onClick={handleApprove}
disabled={!canApprove}
disabled={!canApprove || isPanelOpen}
>
Approve
<CornerDownLeftIcon className="size-3 opacity-60" />
@ -499,6 +500,7 @@ function ApprovalCard({
size="sm"
variant="ghost"
className="rounded-lg text-muted-foreground"
disabled={isPanelOpen}
onClick={() => {
setDecided("reject");
onDecision({ type: "reject", message: "User rejected the action." });