import { useCallback } from 'react' import { useTranslation } from 'react-i18next' import Input from '@/app/components/base/input' import Textarea from '@/app/components/base/textarea' import { PortalSelect } from '@/app/components/base/select' import { InputVarType } from '@/app/components/workflow/types' import { FileUploaderInAttachmentWrapper } from '@/app/components/base/file-uploader' type Props = { inputsForms: any[] inputs: Record inputsRef: any onFormChange: (value: Record) => void } const AppInputsForm = ({ inputsForms, inputs, inputsRef, onFormChange, }: Props) => { const { t } = useTranslation() const handleFormChange = useCallback((variable: string, value: any) => { onFormChange({ ...inputsRef.current, [variable]: value, }) }, [onFormChange, inputsRef]) const renderField = (form: any) => { const { label, variable, options, } = form if (form.type === InputVarType.textInput) { return ( handleFormChange(variable, e.target.value)} placeholder={label} /> ) } if (form.type === InputVarType.number) { return ( handleFormChange(variable, e.target.value)} placeholder={label} /> ) } if (form.type === InputVarType.paragraph) { return (