import "@/app/globals.css"
import "@scandic-hotels/design-system/style.css"

import Script from "next/script"

import TrpcProvider from "@/lib/trpc/Provider"

import AdobeScript from "@/components/Current/AdobeScript"
import VwoScript from "@/components/Current/VwoScript"

import { biroScriptPlus, firaMono, firaSans } from "./fonts"

import type { Metadata } from "next"

import type { LangParams, LayoutArgs } from "@/types/params"

export const metadata: Metadata = {
  description: "New web",
  title: "Scandic Hotels New Web",
}

export default async function RootLayout({
  children,
  params,
}: React.PropsWithChildren<LayoutArgs<LangParams>>) {
  return (
    <html lang={params.lang}>
      <head>
        <Script
          data-cookieconsent="ignore"
          src="/_static/dist/js/cookie-bot.js?1705409331007"
        />
        <Script
          strategy="beforeInteractive"
          data-blockingmode="auto"
          data-cbid="6d539de8-3e67-4f0f-a0df-8cef9070f712"
          data-culture="@cultureCode"
          id="Cookiebot"
          src="https://consent.cookiebot.com/uc.js"
        />
        <Script id="ensure-datalayer">{`
          window.datalayer = window.datalayer || {}
        `}</Script>
        <AdobeScript />
        <VwoScript />
      </head>
      <body
        className={`${firaMono.variable} ${firaSans.variable} ${biroScriptPlus.variable} `}
      >
        <TrpcProvider lang={params.lang}>{children}</TrpcProvider>
        <Script id="page-tracking">{`
          typeof _satellite !== "undefined" && _satellite.pageBottom();
        `}</Script>
      </body>
    </html>
  )
}
