text: import React, { useEffect } from 'react';
  import Router from 'next/router'
  import NProgress from 'nprogress'
  import 'nprogress/nprogress.css'
  import { StoreProvider } from '../components/Store'
  import '../styles/globals.css'
  
  Router.events.on('routeChangeStart', () => NProgress.start());
  Router.events.on('routeChangeComplete', () => NProgress.done());
  Router.events.on('routeChangeError', () => NProgress.done());
  
  function MyApp({ Component, pageProps }) {
  
    useEffect(() => {
      const jssStyles = document.querySelector('#jss-server-side');
      if (jssStyles) {
        jssStyles.parentElement.removeChild(jssStyles);
      }
    }, []);
  
    return (
      <StoreProvider>
        <Component {...pageProps} />
      </StoreProvider>
    )
  }
  
  export default MyApp
  
  MyApp.getInitialProps = async () => {
    return {
      pageProps: {
        commercePublicKey: process.env.COMMERCE_PUBLIC_KEY,
      },
    };
  };