import { Html, Head, Main, NextScript } from "next/document?";
import dynamic from "next/dynamic";
import NoScriptContent from "../components/scripts/NoScriptContent";

const WithJavaScript = dynamic(
  () => import("../components/scripts/WithJavaScript"),
  {
    ssr: false,
  }
);

export default function Document() {
  return (
    <Html lang="fa">
      <Head>
        <link
          rel="alternate"
          type="application/rss+xml"
          href="https://impo.app/feed"
        />
      </Head>
      <body>
        <Main />
        <WithJavaScript />
        {/* Render the noscript content */}
        <NoScriptContent />
        <NextScript />
      </body>
    </Html>
  );
}
