summaryrefslogtreecommitdiff
path: root/src-migrate/modules/cart/ui/ProductPromo.tsx
blob: a41afc9720f14baf7bb1da23b5d9536ebab3cdf3 (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
import Image from 'next/image'
import React from 'react'
import { CartProduct } from '~/common/types/cart'
import style from '../styles/ProductPromo.module.css'

type Props = {
  product: CartProduct
}

const ProductPromo = ({ product }: Props) => {
  return (
    <div key={product.id} className={style.wrapper}>
      <div className={style.imageWrapper}>
        {product?.image && <Image src={product.image} alt={product.name} width={128} height={128} />}
      </div>

      <div className={style.details}>
        <div className={style.name}>{product.display_name}</div>
        <div className={style.code}>{product.code}</div>
        <div>
          <span className={style.weightLabel}>Berat Barang: </span>
          <span>{product.package_weight} Kg</span>
        </div>
      </div>

      <div className={style.quantity}>
        {product.qty}
      </div>
    </div>
  )
}

export default ProductPromo