SILENT KILLERPanel

Current Path: > home > transcarter > public_html > wp-content > plugins > leadin > scripts > > shared > Common >


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 ]

Files and Folders in: /home/transcarter/public_html/wp-content/plugins/leadin/scripts//shared/Common/

NameTypeSizeLast ModifiedActions
AsyncSelect.tsx File 7515 bytes July 17 2025 21:06:25.
ErrorHandler.tsx File 1694 bytes July 17 2025 21:06:25.
HubspotWrapper.ts File 642 bytes July 17 2025 21:06:25.
LoadingBlock.tsx File 341 bytes July 17 2025 21:06:25.
PreviewDisabled.tsx File 746 bytes July 17 2025 21:06:25.

Reading File: /home/transcarter/public_html/wp-content/plugins/leadin/scripts//shared/Common//ErrorHandler.tsx

import React from 'react';
import UIButton from '../UIComponents/UIButton';
import UIContainer from '../UIComponents/UIContainer';
import HubspotWrapper from './HubspotWrapper';
import { adminUrl, redirectNonce } from '../../constants/leadinConfig';
import { pluginPath } from '../../constants/leadinConfig';
import { __ } from '@wordpress/i18n';

interface IErrorHandlerProps {
  status: number;
  resetErrorState?: React.MouseEventHandler<HTMLButtonElement>;
  errorInfo?: {
    header: string;
    message: string;
    action: string;
  };
}

function redirectToPlugin() {
  window.location.href = `${adminUrl}admin.php?page=leadin&leadin_expired=${redirectNonce}`;
}

export default function ErrorHandler({
  status,
  resetErrorState,
  errorInfo = { header: '', message: '', action: '' },
}: IErrorHandlerProps) {
  const isUnauthorized = status === 401 || status === 403;
  const errorHeader = isUnauthorized
    ? __("Your plugin isn't authorized", 'leadin')
    : errorInfo.header;
  const errorMessage = isUnauthorized
    ? __('Reauthorize your plugin to access your free HubSpot tools', 'leadin')
    : errorInfo.message;

  return (
    <HubspotWrapper pluginPath={pluginPath}>
      <UIContainer textAlign="center">
        <h4>{errorHeader}</h4>
        <p>
          <b>{errorMessage}</b>
        </p>
        {isUnauthorized ? (
          <UIButton data-test-id="authorize-button" onClick={redirectToPlugin}>
            {__('Go to plugin', 'leadin')}
          </UIButton>
        ) : (
          <UIButton data-test-id="retry-button" onClick={resetErrorState}>
            {errorInfo.action}
          </UIButton>
        )}
      </UIContainer>
    </HubspotWrapper>
  );
}

SILENT KILLER Tool