import "@/app/global.css";
import { ReactNode } from "react";
import type { Metadata } from "next";
import MouseFollow from "@/components/MouseFollow/MouseFollow";
import Header from "@/components/Header/Header";
import Container from "@/components/Container/Container";
import Footer from "@/components/Footer/Footer";
import AppContextWrapper from "@/contexts/AppContextWrapper";
import { DEFAULT_OG_IMAGE, SITE_NAME } from "@/utils/constants";
import { lexend } from "@/app/fonts";

export const dynamic = "force-dynamic";

const title = `PrestaShop | ${SITE_NAME}`;
const description = "";
const image = DEFAULT_OG_IMAGE;

export const metadata: Metadata = {
  title: title,
  description: description,
  robots: {
    index: false,
    follow: false,
  },
  openGraph: {
    title: title,
    description: description,
    url: `${process.env.SITE_URL}prestashop`,
    siteName: SITE_NAME,
    images: [
      {
        url: image,
        width: 1200,
        height: 630,
      },
    ],
    locale: 'en_GB',
    type: 'website',
  },
  twitter: {
    card: 'summary_large_image',
    title: title,
    description: description,
    images: [image],
  },
};

export default function Layout({ children }: { children: ReactNode }) {
  return (
    <html lang="en" data-theme="dark" className={lexend.variable}>
      <body>
        <AppContextWrapper site="prestashop">
            <MouseFollow />
            <Header />
            <Container>
              <div className="strap" />
            </Container>
            <main id="main-content">{children}</main>
            <Footer />
        </AppContextWrapper>
      </body>
    </html>
  )
}
