/* eslint-disable react/no-danger */ import { readFileSync } from 'fs'; import { join } from 'path'; import Document, { Html, Head, Main, NextScript } from 'next/document'; import type { DocumentContext } from 'next/document'; import { createCache, extractStyle, StyleProvider } from '@ant-design/cssinjs'; class InlineStylesHead extends Head { getCssLinks: Head['getCssLinks'] = ({ allFiles }) => { const { assetPrefix } = this.context; if (!allFiles || allFiles.length === 0) return null; return allFiles .filter((file: any) => /\.css$/.test(file)) .map((file: any) => (