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.validate_price)}
{+voucher.discount !== 0 && (
{voucher.discount}%
{formatIDR(voucher.validate_display_price)}
)}
{voucher.display_quota}
{voucher.display_expired}
{formatIDR(voucher.validate_price)}
x
{quantity}
{formatIDR(+voucher.validate_price * +quantity)}
{quantity}
) }