fix: remove unused props from AIAgentSafetyPopup component

Removes hasSensitiveAction and hasHumanInTheLoop props that were only
used by the hook, not the component itself, fixing ESLint unused vars error.
This commit is contained in:
Zamil Majdy
2026-01-20 21:05:39 -05:00
parent d5ddc41b18
commit bcccaa16cc
2 changed files with 3 additions and 17 deletions

View File

@@ -303,8 +303,6 @@ export function RunAgentModal({
{/* One-time safety popup for AI-generated agents */}
<AIAgentSafetyPopup
hasSensitiveAction={agent.has_sensitive_action}
hasHumanInTheLoop={agent.has_human_in_the_loop}
isOpen={isSafetyPopupOpen}
onAcknowledge={handleSafetyPopupAcknowledge}
/>

View File

@@ -8,14 +8,6 @@ import { ShieldCheckIcon } from "@phosphor-icons/react";
import { useCallback, useEffect, useState } from "react";
interface Props {
/**
* Whether the agent has sensitive actions that require approval
*/
hasSensitiveAction: boolean;
/**
* Whether the agent has human-in-the-loop blocks
*/
hasHumanInTheLoop: boolean;
/**
* Called when the user acknowledges the popup
*/
@@ -30,12 +22,7 @@ interface Props {
* One-time safety popup shown the first time a user runs an AI-generated agent
* with sensitive actions or human-in-the-loop blocks.
*/
export function AIAgentSafetyPopup({
hasSensitiveAction,
hasHumanInTheLoop,
onAcknowledge,
isOpen,
}: Props) {
export function AIAgentSafetyPopup({ onAcknowledge, isOpen }: Props) {
function handleAcknowledge() {
// Mark popup as shown so it won't appear again
storage.set(Key.AI_AGENT_SAFETY_POPUP_SHOWN, "true");
@@ -106,7 +93,8 @@ export function useAIAgentSafetyPopup(
// Only check once after mount (to avoid SSR issues)
if (hasChecked) return;
const hasSeenPopup = storage.get(Key.AI_AGENT_SAFETY_POPUP_SHOWN) === "true";
const hasSeenPopup =
storage.get(Key.AI_AGENT_SAFETY_POPUP_SHOWN) === "true";
const isRelevantAgent = hasSensitiveAction || hasHumanInTheLoop;
setShouldShowPopup(!hasSeenPopup && isRelevantAgent);