import React from 'react' import { Head, router } from '@inertiajs/react' import { formatIDR } from '@/utils' import CustomerLayout from '@/Layouts/CustomerLayout' import VoucherCard from './VoucherCard' import EmptyHere from './IndexPartials/EmptyHere' import { useModalState } from '@/hooks' import Payment from './IndexPartials/Payment' export default function Index({ carts, total, allow_process }) { const paymentModal = useModalState() const handlePayment = () => { paymentModal.toggle() } const handleTopUp = () => { router.get(route('transactions.deposit.topup')) } return (
Keranjang
{carts.length > 0 ? ( <>
{carts.map((item) => ( ))}
Total Harga
Rp. {formatIDR(total)}
{allow_process ? (
Bayar
) : (
Top Up
)}
{allow_process === false && (
saldo tidak cukup
)}
) : ( )}
) }