import type { Metadata } from "next";
import "../styles/global.scss";
import Script from "next/script";
import { AppProvider } from "@/components/App";
import RecaptchaWrapper from "@/components/common/RecaptchaV3";

export const metadata: Metadata = {
  title: "We Buy Any Car - Free Car Valuation - Sell My Car",
  description:
    "Do you want to sell your car? Sell your car with Car Baba! We offer safe, easy and fast car selling service. Enter your car registration number for free and instant online valuation."
};

export default function RootLayout({
  children
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en">
      <head>
          <Script id="gtm-head" strategy="beforeInteractive">
                  {`
                    (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
                    new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
                    j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
                    'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
                    })(window,document,'script','dataLayer','GTM-KLM65QB4');
                  `}
                </Script>
        <link
          rel="stylesheet"
          href="https://payments.worldpay.com/resources/hpp/integrations/embedded/css/hpp-embedded-integration-library.css"
        />
        <link rel="icon" href="/favicon.ico" />
      </head>
       <noscript>
        <iframe
          src="https://www.googletagmanager.com/ns.html?id=GTM-KLM65QB4"
          height="0"
          width="0"
          style={{ display: "none", visibility: "hidden" }}
        ></iframe>
      </noscript> 
      <body>
        <RecaptchaWrapper>
          <AppProvider>{children}</AppProvider>
        </RecaptchaWrapper>
        <div id="custom-html"></div>
      </body>
      
    </html>
  );
}
