import React, { useState, useEffect } from 'react'; import { HiBolt, HiPlus, HiPencil, HiTrash, HiGlobeAlt, HiCurrencyDollar, HiDocumentText } from 'react-icons/hi2'; import { Card, CardContent, CardHeader, CardTitle } from '../../../ui/Card'; import { Button } from '../../../ui/Button'; import Typography from '../../../ui/Typography'; import { ScrollArea } from '../../../ui/scroll-area'; import { useBlockTesterStore } from '../../../../stores/blockTesterStore'; import { cn } from '../../../../lib/utils'; interface ActionEditorProps { actions: Record; onChange: (actions: Record) => void; className?: string; } interface ActionBinding { id: string; type: string; label: string; description?: string; parameters: Record; triggers: string[]; enabled: boolean; } interface ActionDefinition { id: string; name: string; description: string; icon: React.ComponentType; category: 'hedera' | 'web3' | 'custom'; parameters: { name: string; type: string; required: boolean; description: string; defaultValue?: any; }[]; } interface ActionFormProps { actionId: string; action: ActionBinding; availableActions: ActionDefinition[]; onUpdate: (actionId: string, updates: Partial) => void; onClose: () => void; } const ActionForm: React.FC = ({ actionId, action, availableActions, onUpdate, onClose }) => { const actionDef = availableActions.find(a => a.id === action.type); if (!actionDef) return null; return (
Configure {action.label}
{/* Action Label */}
onUpdate(actionId, { label: e.target.value })} className="w-full px-3 py-2 border border-input rounded-lg bg-background text-foreground" placeholder="Display name for this action" />
{/* Action Description */}