import { useMemo, Suspense } from 'react'; import Head from 'next/head'; import type { AppProps } from 'next/app'; import { useEnvTriggerMapping, Networks, NodeSwitcherDialog, useEnvironment, useInitializeEnv, useNodeSwitcherStore, AppLoader, } from '@vegaprotocol/environment'; import './styles.css'; import { usePageTitleStore } from '../stores'; import DialogsContainer from './dialogs-container'; import ToastsManager from './toasts-manager'; import { HashRouter, useLocation } from 'react-router-dom'; import { Bootstrapper } from '../components/bootstrapper'; import { AnnouncementBanner } from '../components/banner'; import { Navbar } from '../components/navbar'; import classNames from 'classnames'; import { ProtocolUpgradeCountdownMode, ProtocolUpgradeInProgressNotification, ProtocolUpgradeProposalNotification, } from '@vegaprotocol/proposals'; import { Telemetry } from '../components/telemetry'; import { SSRLoader } from './ssr-loader'; import { PartyActiveOrdersHandler } from './party-active-orders-handler'; import { MaybeConnectEagerly } from './maybe-connect-eagerly'; import { TransactionHandlers } from './transaction-handlers'; import { useT } from '../lib/use-t'; const Title = () => { const t = useT(); const DEFAULT_TITLE = t('Welcome to Vega trading!'); const { pageTitle } = usePageTitleStore((store) => ({ pageTitle: store.pageTitle, })); const envTriggerMapping = useEnvTriggerMapping(); const { VEGA_ENV } = useEnvironment(); const networkName = envTriggerMapping[VEGA_ENV]; const title = useMemo(() => { if (!pageTitle) return DEFAULT_TITLE; if (networkName) return `${pageTitle} [${networkName}]`; return pageTitle; }, [pageTitle, networkName, DEFAULT_TITLE]); return (