import React, { useState } from 'react'; import { Button } from '../../../ui/Button'; import Typography from '../../../ui/Typography'; import { ScrollArea } from '../../../ui/scroll-area'; import { cn } from '../../../../lib/utils'; import { AttributeSchema, AttributeType } from '../../../../types/block-tester.types'; type AttributeValue = string | number | boolean | string[]; interface AttributeData { schema: AttributeSchema; value: AttributeValue; } interface AttributeEditorProps { attributes: Record; onChange: (attributes: Record) => void; className?: string; } interface AttributeInputProps { name: string; attributeData: AttributeData; onUpdate: (name: string, updates: Partial<{ schema: AttributeSchema; value: AttributeValue }>) => void; } const AttributeInput: React.FC = ({ name, attributeData, onUpdate }) => { const { schema, value } = attributeData; const updateValue = (newValue: AttributeValue) => onUpdate(name, { value: newValue }); const inputClassName = "w-full px-3 py-2 border border-input rounded-lg bg-background text-foreground"; const inputPlaceholder = schema.placeholder || `Enter ${schema.label || name}`; switch (schema.type) { case 'string': return ( updateValue(e.target.value)} className={inputClassName} placeholder={inputPlaceholder} /> ); case 'textarea': return (