Current Path: > home > transcarter > > > > > > www > wp-content > plugins > leadin > scripts > elementor > FormWidget > hooks
Operation : Linux host59.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64 Software : Apache Server IP : 198.54.126.42 | Your IP: 216.73.216.135 Domains : 1034 Domain(s) Permission : [ 0755 ]
Name | Type | Size | Last Modified | Actions |
---|---|---|---|---|
useForms.ts | File | 1347 bytes | July 17 2025 21:06:25. |
import { useState, useEffect } from 'react'; import LoadState, { LoadStateType } from '../../../shared/enums/loadState'; import { ProxyMessages } from '../../../iframe/integratedMessages'; import { usePostAsyncBackgroundMessage } from '../../../iframe/useBackgroundApp'; import { IForm } from '../../../shared/types'; interface FormOption { label: string; value: string; embedVersion: string; } export default function useForms() { const proxy = usePostAsyncBackgroundMessage(); const [loadState, setLoadState] = useState<LoadStateType>( LoadState.NotLoaded ); const [hasError, setError] = useState(null); const [forms, setForms] = useState<FormOption[]>([]); useEffect(() => { if (loadState === LoadState.NotLoaded) { proxy({ key: ProxyMessages.FetchForms, payload: { search: '', }, }) .then(data => { setForms( data.map((form: IForm) => ({ label: form.name, value: form.guid, embedVersion: form.embedVersion, })) ); setLoadState(LoadState.Loaded); }) .catch(error => { setError(error); setLoadState(LoadState.Failed); }); } }, [loadState]); return { forms, loading: loadState === LoadState.Loading, hasError }; }
SILENT KILLER Tool