+ {/* Header */}
+
+
+
+
+
+
+ {phase === "rejected"
+ ? `${displayName} — Rejected`
+ : phase === "processing" || phase === "complete"
+ ? `${displayName} — Approved`
+ : `Approve: ${displayName}`}
+
+ {phase === "processing" ? (
+
+ ) : phase === "complete" ? (
+
Action completed
+ ) : phase === "rejected" ? (
+
Action was cancelled
+ ) : (
+
+ Requires your approval to proceed
+
+ )}
+ {mcpServer && (
+
+ via {mcpServer}
+
+ )}
+
+
+
+ {/* Description */}
+ {toolDescription && phase === "pending" && (
+ <>
+
+
+ >
+ )}
+
+ {/* Parameters */}
+ {Object.keys(args).length > 0 && (
+ <>
+
+
+
Parameters
+ {phase === "pending" && isEditing ? (
+
+ ) : (
+
+ {JSON.stringify(args, null, 2)}
+
+ )}
+
+ >
+ )}
+
+ {/* Action buttons */}
+ {phase === "pending" && (
+ <>
+
+
+ {allowedDecisions.includes("approve") && (
+
+ )}
+ {isMCPTool && (
+
+ )}
+ {canEdit && !isEditing && (
+
+ )}
+ {allowedDecisions.includes("reject") && (
+
+ )}
+
+ >
+ )}
+
+ );
+}
+
+export const GenericHitlApprovalToolUI: ToolCallMessagePartComponent = ({
+ toolName,
+ args,
+ result,
+}) => {
+ const { dispatch } = useHitlDecision();
+
+ if (!result || !isInterruptResult(result)) return null;
+
+ return (
+