'use client'; import { useState } from 'react'; import { FormField } from '@/lib/types'; interface ToolFormProps { fields: FormField[]; onSubmit: (data: Record) => void; loading?: boolean; } export default function ToolForm({ fields, onSubmit, loading }: ToolFormProps) { const [values, setValues] = useState>({}); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); onSubmit(values); }; return (
{fields.map((field) => (
{field.type === 'textarea' ? (