import { useTranslation } from 'react-i18next' import { useChatWithHistoryContext } from '../context' import { PortalSelect } from '@/app/components/base/select' const Form = () => { const { t } = useTranslation() const { inputsForms, newConversationInputs, handleNewConversationInputsChange, isMobile, } = useChatWithHistoryContext() const handleFormChange = (variable: string, value: string) => { handleNewConversationInputsChange({ ...newConversationInputs, [variable]: value, }) } const renderField = (form: any) => { const { label, required, max_length, variable, options, } = form if (form.type === 'text-input') { return ( handleFormChange(variable, e.target.value)} placeholder={`${label}${!required ? `(${t('appDebug.variableTable.optional')})` : ''}`} /> ) } if (form.type === 'paragraph') { return (