Current Path: > home > transcarter > public_html > wp-content > > plugins > leadin > scripts > shared > Form
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 |
---|---|---|---|---|
hooks | Directory | - | - | |
FormEdit.tsx | File | 2659 bytes | July 17 2025 21:06:25. | |
FormSelect.tsx | File | 2167 bytes | July 17 2025 21:06:25. | |
FormSelector.tsx | File | 881 bytes | July 17 2025 21:06:25. | |
PreviewForm.tsx | File | 1587 bytes | July 17 2025 21:06:25. |
import React, { useEffect, useRef } from 'react'; import UIOverlay from '../UIComponents/UIOverlay'; import { formsScriptPayload, hublet as region, } from '../../constants/leadinConfig'; import PreviewDisabled from '../Common/PreviewDisabled'; export default function PreviewForm({ portalId, formId, fullSiteEditor, embedVersion, }: { portalId: number; formId: string; fullSiteEditor?: boolean; embedVersion?: string; }) { const isFormV4 = embedVersion === 'v4'; const inputEl = useRef<HTMLDivElement>(null); useEffect(() => { if (inputEl.current) { //@ts-expect-error Hubspot global const hbspt = window.parent.hbspt || window.hbspt; inputEl.current.innerHTML = ''; const isQa = formsScriptPayload.includes('qa'); if (isFormV4) { const container = document.createElement('div'); container.classList.add('hs-form-frame'); container.dataset.region = region; container.dataset.formId = formId; container.dataset.portalId = portalId.toString(); container.dataset.env = isQa ? 'qa' : ''; inputEl.current.appendChild(container); } else { const additionalParams = isQa ? { env: 'qa' } : {}; hbspt.forms.create({ portalId, formId, region, target: `#${inputEl.current.id}`, ...additionalParams, }); } } }, [formId, portalId, inputEl, isFormV4]); if (fullSiteEditor) { return <PreviewDisabled />; } return <UIOverlay ref={inputEl} id={`hbspt-previewform-${formId}`} />; }
SILENT KILLER Tool