import { getLocale } from "next-intl/server";
import BackgroundCarousel from "src/components/BackgroundCarousel";
import graphql from "src/utils/graphql";
import AboutUs from "./components/AboutUs";
import CounterDetail from "./components/CounterDetail";
import Products from "./components/Products";
import Sides from "./components/Sides";
const images = [
  {
    image: "/images/fmcg.jpg",
    title: "FMCG",
    link: "/products/fmcg",
  
  },
  {
    image: "/images/construction.jpg",
    title: "Construction",
    link: "/products/construction",
  
  },
  // {
  //   url:"/images/feed.jpg",
  //   name:"Feed",
  //   link:"/products/feed"
  // }
]

const gql_stats = `
query Stats($locale:I18NLocaleCode) {
    stats(locale: $locale) {
        title
        stat
        subtitle
        documentId
    }
}
`


const getStats = async () => {
  const locale = await getLocale()
  console.log("locale", locale)
  const stats = await graphql(gql_stats, {
    locale: locale
  })

  return stats.stats

}


const Landing = async () => {

  const stats = await getStats()

  return (
    <div className=" ">
      {" "}

      {/* <HeroSection /> */}
      <BackgroundCarousel images={images} />
      <AboutUs />
      <CounterDetail stats={stats} />
      <Sides />

      <Products />
      {/* <WhyHorizon/> */}
     

    </div>
  );
};

export default Landing;
