$13 GRAYBYTE WORDPRESS FILE MANAGER $37

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.180
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/home/bravrvjk/kigalix.com/wp-content/plugins/leadin/scripts/shared/Form/

HOME
Current File : /home/bravrvjk/kigalix.com/wp-content/plugins/leadin/scripts/shared/Form//PreviewForm.tsx
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}`} />;
}


Current_dir [ WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
8 May 2025 7.51 AM
bravrvjk / bravrvjk
0755
hooks
--
8 May 2025 7.51 AM
bravrvjk / bravrvjk
0755
FormEdit.tsx
2.597 KB
28 Apr 2025 7.44 AM
bravrvjk / bravrvjk
0644
FormSelect.tsx
2.116 KB
28 Apr 2025 7.44 AM
bravrvjk / bravrvjk
0644
FormSelector.tsx
0.86 KB
28 Apr 2025 7.44 AM
bravrvjk / bravrvjk
0644
PreviewForm.tsx
1.55 KB
28 Apr 2025 7.44 AM
bravrvjk / bravrvjk
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF