$16 GRAYBYTE WORDPRESS FILE MANAGER $87

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | 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/Common/

HOME
Current File : /home/bravrvjk/kigalix.com/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>
  );
}


Current_dir [ WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
8 May 2025 7.51 AM
bravrvjk / bravrvjk
0755
AsyncSelect.tsx
7.339 KB
28 Apr 2025 7.44 AM
bravrvjk / bravrvjk
0644
ErrorHandler.tsx
1.654 KB
28 Apr 2025 7.44 AM
bravrvjk / bravrvjk
0644
HubspotWrapper.ts
0.627 KB
28 Apr 2025 7.44 AM
bravrvjk / bravrvjk
0644
LoadingBlock.tsx
0.333 KB
28 Apr 2025 7.44 AM
bravrvjk / bravrvjk
0644
PreviewDisabled.tsx
0.729 KB
28 Apr 2025 7.44 AM
bravrvjk / bravrvjk
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF