import { dir } from "i18next";
import Header from "@/components/nav_foot/header";
import Navbar from "@/components/nav_foot/navbar";
import Footer from "@/components/nav_foot/footer";
import Contact from "@/components/pageParts/contact";
import UpScrollIcon from "@/components/lib_components/upScroll";
import { Suspense } from "react";
import Time from "@/components/lib_components/time";

export default async function LangLayout({
  children,
  params,
}: {
  children: React.ReactNode;
  params: Promise<{ lang: string }>; // ✅ Promise shaklda
}) {
  const { lang } = await params; // ✅ await bilan destructuring

  return (
    <html lang={lang} dir="rtl">
      <body>
        <Suspense fallback={null}>
          <Header />
        </Suspense>
        <Navbar />
        {children}
        <section id="contact">
          <Contact />
        </section>
        <Footer />
        <UpScrollIcon />
        <Time/>
      </body>
    </html>
  );
}
