/*
 * SPDX-FileCopyrightText: 2023 Kristóf Marussy
 *
 * SPDX-License-Identifier: MIT
 */

import Head from '@docusaurus/Head';
import type { Props } from '@theme/Root';
import Root from '@theme-original/Root';

import ActiveSectionProvider from '@site/src/components/ActiveSectionProvider';
import fontURL from '@site/src/fonts/recursive-latin.woff2?url';

export default function RootWrapper(props: Props) {
  return (
    <ActiveSectionProvider>
      <Head>
        <link
          rel="preload"
          href={fontURL}
          as="font"
          type="font/woff2"
          crossOrigin="anonymous"
        />
      </Head>
      <Root {...props} />
    </ActiveSectionProvider>
  );
}
