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, allow_process, is_paylater, }) { const handleSubmit = () => { router.post(route('cart.purchase')) } const handleTopUp = () => { router.get(route('customer.deposit.topup')) } return (
Keranjang
{carts.length > 0 ? ( <>
{carts.map((item) => ( ))}
{is_paylater && (
Saldo tidak cukup, melanjutkan transaksi dengan paylatermu
)} {/*
Saldo: {formatIDR(user.deposit_balance)} {is_paylater && ( <> {' '} | Limit:{' '} {formatIDR(user.paylater_limit)} )}
*/}
TOTAL
{formatIDR(total)}
{allow_process ? (
Bayar
) : (
Saldo tidak cukup
Top Up
)}
) : ( )}
) }