import { Suspense } from 'react'
import Container from '@/components/frontend/Container'
import FlashSale from '@/components/frontend/home/FlashSale'
import HeroPremium from '@/components/frontend/home/blocks/premium/HeroPremium'
import CategoryRail from '@/components/frontend/home/blocks/premium/CategoryRail'
import ArrivalsBento from '@/components/frontend/home/blocks/premium/ArrivalsBento'
import BestSellers from '@/components/frontend/home/blocks/premium/BestSellers'
import ReviewsPremium from '@/components/frontend/home/blocks/premium/ReviewsPremium'
import PromiseBand from '@/components/frontend/home/blocks/premium/PromiseBand'
import BrandsShowcase from '@/components/frontend/home/blocks/BrandsShowcase'
import BlogTeaser from '@/components/frontend/home/blocks/BlogTeaser'
import { PromoRow, PromoPair, WideBanner } from '@/components/frontend/home/blocks/BannerSections'
import { SectionSkeleton } from '@/components/frontend/skeletons/Skeletons'
import type { HomeBanners } from '@/lib/db/queries/getHeroBanners'

// Design 3 — "Premium": a dark, glowing hero band (slider + product
// spotlight + live store numbers), then roomy sections with heavy display
// type: category rail, promo row, new-arrivals bento, flash sale, best
// sellers, promises band, promo pair, brands, reviews with the real average
// rating, journal, wide banner. Every section hides itself without data.
export default function HomePremium({ banners, heading }: { banners: HomeBanners; heading: string }) {
  return (
    <>
      <h1 className="sr-only">{heading}</h1>
      <HeroPremium slides={banners.hero} />
      <Container className="py-14 sm:py-20">
        <div className="flex flex-col gap-16 sm:gap-24 [&>*]:my-0!">
          <Suspense fallback={<SectionSkeleton count={4} />}>
            <CategoryRail />
          </Suspense>
          <PromoRow banners={banners.top} variant="modern" />
          <Suspense fallback={<SectionSkeleton />}>
            <ArrivalsBento />
          </Suspense>
          <Suspense fallback={<SectionSkeleton />}>
            <FlashSale />
          </Suspense>
          <Suspense fallback={<SectionSkeleton />}>
            <BestSellers />
          </Suspense>
          <PromiseBand />
          <PromoPair banners={banners.middle} variant="modern" />
          <Suspense fallback={null}>
            <BrandsShowcase variant="premium" />
          </Suspense>
          <Suspense fallback={<SectionSkeleton count={3} />}>
            <ReviewsPremium />
          </Suspense>
          <Suspense fallback={<SectionSkeleton count={3} />}>
            <BlogTeaser variant="premium" />
          </Suspense>
          <WideBanner banners={banners.bottom} variant="modern" />
        </div>
      </Container>
    </>
  )
}
