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

@ -249,6 +249,7 @@ function ApprovalCard({
setIsPanelOpen(false);
setPendingEdits({ name: newName, content: newContent });
},
onClose: () => setIsPanelOpen(false),
});
}}
>
@ -376,7 +377,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" />
@ -387,6 +388,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." });