import React from 'react'
import { Head, router } from '@inertiajs/react'
import CustomerLayout from '@/Layouts/CustomerLayout'
import VoucherCard from './VoucherCard'
import { formatIDR } from '@/utils'
const EmptyHere = () => {
return (
Wah, keranjang belanjamu kosong
Yuk, pilih paket voucher terbaik mu!
)
}
export default function Index({ auth: { user }, carts, total }) {
const canPay = +user.deposit_balance >= +total
const handleSubmit = () => {
router.post(route('cart.purchase'))
}
const handleTopUp = () => {
router.get(route('customer.deposit.topup'))
}
return (
Keranjang
{carts.length > 0 ? (
<>
{carts.map((item) => (
))}
Saldo: {formatIDR(user.deposit_balance)}
{canPay ? (
Bayar
) : (
)}
>
) : (
)}
)
}