Files
hoanghapc_nextJs/src/components/product/detail/buttons/index.tsx

37 lines
1.7 KiB
TypeScript
Raw Normal View History

2026-01-31 12:00:43 +07:00
'use client';
import { useCart } from '@/hooks/useCart';
export default function Buttons( {item}:any ) {
const { addToCart } = useCart();
2026-01-28 17:26:02 +07:00
return (
<>
<div className="pd-button-group my-5 gap-2 grid grid-cols-2 text-18 font-500">
<button
type="button"
className="col-span-2 uppercase rounded-[12px] text-white h-[52px] border border-[#FFD83E] bg-[linear-gradient(148.21deg,#FFD83E_-14.02%,#FF4E2A_70.14%)]"
aria-label="Mua sản phẩm"
2026-01-31 12:00:43 +07:00
onClick={() => addToCart(item, 1, '/cart')}
2026-01-28 17:26:02 +07:00
>
2026-01-31 12:00:43 +07:00
Mua ngay
2026-01-28 17:26:02 +07:00
</button>
2026-01-31 12:00:43 +07:00
2026-01-28 17:26:02 +07:00
<button
type="button"
className="col-span-1 flex items-center justify-center uppercase rounded-[12px] text-white h-[52px] border border-[#259AFF] bg-[linear-gradient(165.29deg,#259AFF_8.53%,#114CDD_93.19%)]"
aria-label="Mua sản phẩm"
2026-01-31 12:00:43 +07:00
onClick={() => addToCart(item)}
2026-01-28 17:26:02 +07:00
>
<i className="icons icon-cart !w-[22px] !h-[22px] mr-[6px]" />
<span> Thêm vào giỏ </span>
</button>
2026-01-31 12:00:43 +07:00
<a href='https://hoanghapc.vn/huong-dan-mua-tra-gop' target='_blank'
2026-01-28 17:26:02 +07:00
className="col-span-1 flex items-center justify-center uppercase rounded-[12px] text-white h-[52px] border border-[#259AFF] bg-[linear-gradient(165.29deg,#259AFF_8.53%,#114CDD_93.19%)]"
>
<i className="icons icon-card w-[22px] h-[22px] mr-[6px]" />
<span> Mua trả góp </span>
2026-01-31 12:00:43 +07:00
</a>
2026-01-28 17:26:02 +07:00
</div>
</>
)
}