import Head from 'next/head';
import {CustomRedirects} from 'src/components/customRedirects';
import {MultiPageContext, ScrollManager} from 'src/components/scrollManager';
import {LanguageProvider} from '@/content/languages';
import Watermark from 'src/components/Watermark';
import {RouteProvider} from "src/components/routeProvider";
import '@speakeasy-sdks/nextra-theme-docs/style.css';
import '@code-hike/mdx/dist/index.css';
import '@/src/styles/index.scss';

{/* Order matters in the style imports below. */}

export default function App(props) {
  const {Component, pageProps} = props;

  return (
    <MultiPageContext.Provider value={true}>
      <Head>
        <link rel='preconnect' href='https://fonts.gstatic.com'/>
        <link
          href='https://fonts.googleapis.com/css2?family=Inter&display=swap'
          rel='stylesheet'
        />
        <link
          href='https://fonts.googleapis.com/css2?family=IBM+Plex+Mono&display=swap'
          rel='stylesheet'
        />
      </Head>
      <RouteProvider>
        <ScrollManager>
          <CustomRedirects/>
          <LanguageProvider>
            <Component {...pageProps} />
          </LanguageProvider>
        </ScrollManager>
      </RouteProvider>
      <Watermark/>
    </MultiPageContext.Provider>
  );
}
