import dynamic from "next/dynamic"
import Seo from "@/core/components/Seo"
import ImageSkeleton from "@/core/components/elements/Skeleton/ImageSkeleton"
import PopularProductSkeleton from "@/lib/home/components/Skeleton/PopularProductSkeleton"

const BasicLayout = dynamic(() => import("@/core/components/layouts/BasicLayout"))

const HeroBanner = dynamic(() => import("@/lib/home/components/HeroBanner"), {
  loading: () => <ImageSkeleton />
})

const PreferredBrand = dynamic(() => import("@/lib/home/components/PreferredBrand"), {
  loading: () => <PopularProductSkeleton />
})

const PopularProduct = dynamic(() => import("@/lib/home/components/PopularProduct"), {
  loading: () => <PopularProductSkeleton />
})

const CategoryHomeId = dynamic(() => import("@/lib/home/components/CategoryHomeId"), {
  loading: () => <PopularProductSkeleton />
})

export default function Home() {
  return (
    <BasicLayout>
      <Seo title="Beranda - Indoteknik" />
      <HeroBanner />
      <div className="flex flex-col gap-y-6 my-6">
        <PreferredBrand />
        <PopularProduct />
        <CategoryHomeId />
      </div>
    </BasicLayout>
  )
}