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_profile.location.name}
{voucher.location_profile.display_note}
IDR {formatIDR(voucher.validate_price)}
{+voucher.discount !== 0 && (
{voucher.discount}%
{formatIDR(voucher.validate_display_price)}
)}
{voucher.location_profile.quota}
{voucher.location_profile.diplay_expired}
{formatIDR(voucher.validate_price)}
x
{quantity}
{formatIDR(+voucher.validate_price * +quantity)}
{quantity}
) }