/* eslint-disable react/no-danger */ /* eslint-disable react/no-unescaped-entities */ import { Layout } from 'antd'; import { useRecoilValue } from 'recoil'; import Head from 'next/head'; import { FC, useEffect, useRef } from 'react'; import { ClientConfigStore, isChatAvailableSelector, clientConfigStateAtom, fatalErrorStateAtom, } from '../stores/ClientConfigStore'; import { Content } from '../ui/Content/Content'; import { Header } from '../ui/Header/Header'; import { ClientConfig } from '../../interfaces/client-config.model'; import { DisplayableError } from '../../types/displayable-error'; import { FatalErrorStateModal } from '../modals/FatalErrorStateModal/FatalErrorStateModal'; import setupNoLinkReferrer from '../../utils/no-link-referrer'; export const Main: FC = () => { const clientConfig = useRecoilValue(clientConfigStateAtom); const { name, title, customStyles } = clientConfig; const isChatAvailable = useRecoilValue(isChatAvailableSelector); const fatalError = useRecoilValue(fatalErrorStateAtom); const layoutRef = useRef(null); const { chatDisabled } = clientConfig; useEffect(() => { setupNoLinkReferrer(layoutRef.current); }, []); const hydrationScript = ` window.statusHydration = {{.StatusJSON}}; window.configHydration = {{.ServerConfigJSON}}; `; return ( <>