import type { Metadata } from "next";
import { getTranslations } from "next-intl/server";
import { Navbar } from "@/components/layout/navbar";
import { Footer } from "@/components/layout/footer";
import { LaunchCountdownSection } from "@/components/sections/launch-countdown-section";
import { Hero } from "@/components/sections/hero";
import { Stats } from "@/components/sections/stats";
import { TrustBar } from "@/components/sections/trust-bar";
import { Features } from "@/components/sections/features";
import { HowItWorks } from "@/components/sections/how-it-works";
import { AppPromo } from "@/components/sections/app-promo";
import { Testimonials } from "@/components/sections/testimonials";
import { PricingSection } from "@/components/sections/pricing-section";
import { Faq } from "@/components/sections/faq";
import { CtaBanner } from "@/components/sections/cta-banner";
import { JsonLd } from "@/components/seo/json-ld";

export async function generateMetadata({
  params,
}: {
  params: Promise<{ locale: string }>;
}): Promise<Metadata> {
  const { locale } = await params;
  const t = await getTranslations({ locale, namespace: "meta" });
  return {
    title: t("homeTitle"),
    description: t("homeDescription"),
  };
}

export default async function HomePage({ params }: { params: Promise<{ locale: string }> }) {
  const { locale } = await params;
  return (
    <>
      <JsonLd type="SoftwareApplication" locale={locale} />
      <JsonLd type="Organization" locale={locale} />
      <JsonLd type="WebSite" locale={locale} />
      <Navbar />
      <main>
        <LaunchCountdownSection />
        <Hero />
        <TrustBar />
        <Stats />
        <Features />
        <HowItWorks />
        <AppPromo />
        <Testimonials />
        <PricingSection />
        <Faq />
        <CtaBanner />
      </main>
      <Footer />
    </>
  );
}
