import React from 'react'; // @ts-ignore import slide from 'App/svg/cheers.svg'; import { Button, Loader } from 'UI'; import Footer from './Footer'; import { getHighest } from 'App/constants/zindex'; import Category from 'Components/Header/HealthStatus/ServiceCategory'; import SubserviceHealth from 'Components/Header/HealthStatus/SubserviceHealth/SubserviceHealth'; import { IServiceStats } from '../HealthStatus'; function HealthModal({ getHealth, isLoading, healthResponse, setShowModal, setPassed, }: { getHealth: () => void; isLoading: boolean; healthResponse: { overallHealth: boolean; healthMap: Record; }; setShowModal: (isOpen: boolean) => void; setPassed?: () => void; }) { const [selectedService, setSelectedService] = React.useState(''); React.useEffect(() => { if (!healthResponse?.overallHealth) { if (healthResponse?.healthMap) { setSelectedService( Object.keys(healthResponse.healthMap).filter( (s) => !healthResponse.healthMap[s].healthOk )[0] ); } } }, [healthResponse]); const handleClose = () => { setShowModal(false); }; const isSetup = document.location.pathname.includes('/signup'); return (
e.stopPropagation()} className={ 'flex flex-col bg-white rounded border border-figmaColors-divider' } >
Installation Status
{healthResponse ? ( <>
{isLoading ? null : Object.keys(healthResponse.healthMap).map((service) => ( setSelectedService(service)} healthOk={ healthResponse.healthMap[service].healthOk } name={healthResponse.healthMap[service].name} isSelectable isSelected={selectedService === service} /> ))}
{isLoading ? null : selectedService ? ( ) : ( )}
{isSetup ? (
) : null} ) : (
Error while fetching data...
)}
); } function ServiceStatus({ service }: { service: Record }) { const { subservices } = service; return (
{Object.keys(subservices).map((subservice: string) => ( ))}
); } export default HealthModal;