import type { ReactNode } from 'react'; import { NotFoundPage } from '@/pages/NotFoundPage'; import { useContactSettings } from '../services/useContactSettings'; /** * The module can be loaded while the management routes are closed (host switch off: every route answers 404 with an * empty body). In that case the screen does not exist: the usual "not found" page is shown. */ export function ContactAvailabilityGuard({ children }: { children: ReactNode }) { const { data, isPending, isError } = useContactSettings(); if (isPending) { return (
); } if (isError || data === null) return ; return <>{children}; }