import { Suspense } from "react";
import { getDictionary } from "@/lib/dictionaries";
import { Hero } from "@/components/sections/Hero";
import { Features } from "@/components/sections/Features";
import { Pricing } from "@/components/sections/Pricing";
import { FAQ } from "@/components/sections/Faq";
import { BlogPreview } from "@/components/sections/BlogPreview";
import { TerminalGuestbook } from "@/components/sections/TerminalGuestbook";

export default async function Home({
  params,
}: {
  params: Promise<{ lang: string }>;
}) {
  const { lang } = await params;
  const dict = await getDictionary(lang);

  return (
    <>
      {/* Добавили передачу lang в Hero */}
      <Hero dict={dict.hero} lang={lang} />
      <Features dict={dict.features} />
      <Pricing dict={dict.pricing} lang={lang} />
      <FAQ dict={dict.faq} lang={lang} />
      <TerminalGuestbook dict={dict.guestbook} />
      <Suspense fallback={<div className="py-20 text-center">Loading...</div>}>
        <BlogPreview lang={lang} dict={dict.blog} />
      </Suspense>
    </>
  );
}
