'use client' import * as React from 'react' import { Wrench, AlertTriangle, Loader2, Check, X } from 'lucide-react' import { cn } from '@open-mercato/shared/lib/utils' import { Button } from '@open-mercato/ui/primitives/button' import type { PendingToolCall } from '../../types' interface ToolCallConfirmationProps { toolCall: PendingToolCall onApprove: () => void onReject: () => void } const DESTRUCTIVE_PATTERNS = [/^delete/i, /^remove/i, /\.delete$/i, /\.remove$/i] function isDestructive(toolName: string): boolean { return DESTRUCTIVE_PATTERNS.some((p) => p.test(toolName)) } export function ToolCallConfirmation({ toolCall, onApprove, onReject, }: ToolCallConfirmationProps) { const destructive = isDestructive(toolCall.toolName) // Show different UI based on status if (toolCall.status === 'executing') { return (
{JSON.stringify(toolCall.args, null, 2)}
)}
This action may not be reversible.
)}