import * as React from 'react' ; import { AppProps } from 'next/app' ; import '@docsearch/css' ; import '../styles/fonts.css' ; import '../styles/algolia.css' ; import '../styles/index.css' ; import '../styles/sandpack.css' ; import '@codesandbox/sandpack-react/dist/index.css' ; import { hotjar } from 'utils/hotjar' ; if ( typeof window !== 'undefined' ) { hotjar ( process . env . NEXT_PUBLIC_HJ_SITE_ID , process . env . NEXT_PUBLIC_HJ_SITE_V ) ; } const EmptyAppShell = ( { children } ) => < > { children } < />; export default function MyApp ( { Component , pageProps } ) { let AppShell = ( Component as any ) . appShell || EmptyAppShell ; if ( ( Component as any ) . isMDXComponent ) { AppShell = ( Component as any ) ( { } ) . props . originalType . appShell ; } React . useEffect ( ( ) => { if ( process . env . NODE_ENV !== 'production' ) { ( window as any ) . gtag = ( ... args ) => { console . log ( 'gtag: ' , ... args ) ; } ; } } , [ ] ) ; return ( < AppShell > < Component { ... pageProps } / > < /AppShell>); }