import Document, { Html, Head, Main, NextScript } from "next/document";

class MyDocument extends Document {
  render() {
    const { locale } = this.props.__NEXT_DATA__;
    const dir = locale === "ar" ? "rtl" : "ltr";
    return (
      <Html dir={dir} lang={locale}>
        <Head>
          <link
            href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap"
            rel="stylesheet"
          />

          {/* Icons */}
          <link rel="icon" href="/images/icons/favicon.ico" />
          <link
            rel="icon"
            href="/images/icons/favicon-16x16.png"
            sizes="16x16"
            type="image/png"
          />
          <link
            rel="icon"
            href="/images/icons/android-chrome-192x192.png"
            sizes="192x192"
            type="image/png"
          />
          <link rel="apple-touch-icon" href="/icons/apple-touch-icon.png" />
          <link
            rel="icon"
            href="/images/icons/android-chrome-512x512.png"
            sizes="512x512"
            type="image/png"
          />
        </Head>
        <body>
          <Main />
          <NextScript />
        </body>
      </Html>
    );
  }
}

export default MyDocument;
