import dynamic from 'next/dynamic';
import React, { useState } from 'react';
import { LazyLoadComponent } from 'react-lazy-load-image-component';
import Hero from '~/modules/promo/components/Hero';
import PromotionProgram from '~/modules/promo/components/PromotinProgram';
import Voucher from '~/modules/promo/components/Voucher';
import FlashSale from '../../../modules/promo/components/FlashSale';
import FlashSaleNonDisplay from '../../../modules/promo/components/FlashSaleNonDisplay';
const PromoList = dynamic(
  () => import('../../../modules/promo/components/PromoList')
);

const PromoPage = () => {
  const [selectedPromo, setSelectedPromo] = useState('Bundling');
  return (
    <>
      <LazyLoadComponent>
        <Hero />
      </LazyLoadComponent>
      <LazyLoadComponent>
        <PromotionProgram
          selectedPromo={selectedPromo}
          onSelectPromo={setSelectedPromo}
        />
        <PromoList selectedPromo={selectedPromo} />
      </LazyLoadComponent>

      <LazyLoadComponent>
        <FlashSale />
      </LazyLoadComponent>
      <h1 className='h-1'></h1>
      <LazyLoadComponent>
        <FlashSaleNonDisplay />
      </LazyLoadComponent>
      <h1 className='h-1'></h1>
      <LazyLoadComponent>
        <Voucher />
      </LazyLoadComponent>
    </>
  );
};

export default PromoPage;
