{% extends "web/pages/base_page.js.jinja2" %}

{% block early_imports %}
import '/styles/styles.css'
{% endblock %}

{% block declaration %}
import { EventLoopProvider, StateProvider } from "/utils/context.js";
import { ThemeProvider } from 'next-themes'


{% for custom_code in custom_codes %}
{{custom_code}}
{% endfor %}
{% endblock %}

{% block export %}
function AppWrap({children}) {

  {% for hook in hooks %}
  {{ hook }}
  {% endfor %}

  return (
    {{utils.render(render, indent_width=0)}}
  )
}

export default function MyApp({ Component, pageProps }) {
  return (
    <ThemeProvider defaultTheme="light" storageKey="chakra-ui-color-mode" attribute="class">
      <AppWrap>
        <StateProvider>
          <EventLoopProvider>
            <Component {...pageProps} />
          </EventLoopProvider>
        </StateProvider>
      </AppWrap>
    </ThemeProvider>
  );
}

{% endblock %}
