import { formatIDR } from '@/utils' import { router } from '@inertiajs/react' import { HiMinusCircle, HiPlusCircle, HiTrash } from 'react-icons/hi2' export default function VoucherCard({ item: { voucher, quantity } }) { const handleDelete = () => { router.post(route('cart.store', { voucher: voucher, param: 'delete' })) } const handleAdd = () => { router.post(route('cart.store', { voucher: voucher, param: 'add' })) } const handleSub = () => { router.post(route('cart.store', { voucher: voucher, param: 'sub' })) } return (
{voucher.location.name}
{voucher.profile}
IDR {formatIDR(voucher.price)}
{+voucher.discount !== 0 && (
{voucher.discount}%
{formatIDR(voucher.display_price)}
)}
{voucher.display_quota}
{voucher.display_expired}
{formatIDR(voucher.price)}
x
{quantity}
{formatIDR(+voucher.price * +quantity)}
{quantity}
) }