summaryrefslogtreecommitdiff
path: root/src-migrate/modules/cart/components/ItemPromo.tsx
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-06-21 11:01:35 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-06-21 11:01:35 +0700
commit220190db66bcc1c6db78180c593f21e9cf8f363c (patch)
tree1517faa9636a6b3b2cc8d468a57b1fe476c229d7 /src-migrate/modules/cart/components/ItemPromo.tsx
parent208b234320b6c42491a4e87a1c3db3abab9c1715 (diff)
parent1cf754b4d8da1aa28700ffc3dad67081f6daf9a5 (diff)
Merge branch 'promotion-program' into feature/all-promotion
Diffstat (limited to 'src-migrate/modules/cart/components/ItemPromo.tsx')
-rw-r--r--src-migrate/modules/cart/components/ItemPromo.tsx12
1 files changed, 8 insertions, 4 deletions
diff --git a/src-migrate/modules/cart/components/ItemPromo.tsx b/src-migrate/modules/cart/components/ItemPromo.tsx
index bc507578..878e17ac 100644
--- a/src-migrate/modules/cart/components/ItemPromo.tsx
+++ b/src-migrate/modules/cart/components/ItemPromo.tsx
@@ -1,7 +1,8 @@
import style from '../styles/item-promo.module.css'
import Image from 'next/image'
-import React from 'react'
+import Link from 'next/link'
+import { createSlug } from '~/libs/slug'
import { CartProduct } from '~/types/cart'
@@ -12,12 +13,15 @@ type Props = {
const CartItemPromo = ({ product }: Props) => {
return (
<div key={product.id} className={style.wrapper}>
- <div className={style.imageWrapper}>
+ <Link href={createSlug('/shop/product/', product.parent.name, product.parent.id.toString())} className={style.imageWrapper}>
{product?.image && <Image src={product.image} alt={product.name} width={128} height={128} className={style.image} />}
- </div>
+ </Link>
<div className={style.details}>
- <div className={style.name}>{product.display_name}</div>
+ <Link href={createSlug('/shop/product/', product.parent.name, product.parent.id.toString())} className={style.name}>
+ {product.display_name}
+ </Link>
+
<div className='flex w-full'>
<div className="flex flex-col">
<div className={style.code}>{product.code}</div>