/* eslint-disable */
import React from 'react';
import PropTypes from 'prop-types';
import cookies from 'next-cookies';
// @ts-ignore
import flush from 'styled-jsx/server';
import Document, { Head, Main, NextScript, NextDocumentContext } from 'next/document';
import { prismThemes } from '../utils/prism';
import { ThemeType } from 'layout/PageWithContext';
import { PageContext } from '../utils/getPageContext';
class MyDocument extends Document<{ theme?: ThemeType }> {
static getInitialProps = (ctx: NextDocumentContext) => {
// Render app and page and get the context of the page with collected side effects.
let pageContext: PageContext | undefined;
const { theme } = cookies(ctx as any);
const page = ctx.renderPage((Component) => {
const WrappedComponent = (props: any) => {
pageContext = props.pageContext;
return