import { Layout } from 'antd'; import { useRecoilValue } from 'recoil'; import Head from 'next/head'; import { useEffect, useRef } from 'react'; import { ClientConfigStore, isChatAvailableSelector, clientConfigStateAtom, fatalErrorStateAtom, } from '../stores/ClientConfigStore'; import { Content, Header } from '../ui'; 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'; function Main() { const clientConfig = useRecoilValue(clientConfigStateAtom); const { name, title, customStyles } = clientConfig; const isChatAvailable = useRecoilValue(isChatAvailableSelector); const fatalError = useRecoilValue(fatalErrorStateAtom); const layoutRef = useRef(null); useEffect(() => { setupNoLinkReferrer(layoutRef.current); }, []); return ( <>
{fatalError && ( )} ); } export default Main;