summaryrefslogtreecommitdiff
path: root/src/pages/index.jsx
blob: 70231f7e91564babaf97e129f5c2a9e3159536bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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'
import MobileView from '@/core/components/views/MobileView'
import DesktopView from '@/core/components/views/DesktopView'
import Category from '@/lib/category/components/Category'

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' />
      <DesktopView>
        <div className="container mx-auto">
          <div className='flex'>
            <div className='w-3/12'>
              <Category />
            </div>
            <div className='w-6/12 px-1'>
              <HeroBanner />
            </div>
          </div>
        </div>
      </DesktopView>

      <MobileView>
        <HeroBanner />
        <div className='flex flex-col gap-y-6 my-6'>
          <PreferredBrand />
          <PopularProduct />
          <CategoryHomeId />
        </div>
      </MobileView>
    </BasicLayout>
  )
}