'use client' import { verifyPayment } from "@/actions/payment"; import { Table, TableBody, TableCaption, TableCell, TableFooter, TableRow, } from "@/components/ui/table"; import { formatDate } from "@/lib/utils"; import type { Prisma, User } from "@prisma/client"; import { BadgeDollarSign, Clipboard, ClipboardCheck, Loader2, Wallet } from "lucide-react"; import { useState } from "react"; import { toast } from "sonner"; import { Button } from "./ui/button"; type PaymentWithDevices = Prisma.PaymentGetPayload<{ include: { devices: true; }; }>; export default function DevicesToPay({ payment, user }: { payment?: PaymentWithDevices, user?: User }) { const [verifying, setVerifying] = useState(false) const devices = payment?.devices; if (devices?.length === 0) { return null; } // 100+(n−1)×75 const walletBalance = user?.walletBalance ?? 0; const isWalletPayVisible = walletBalance > (payment?.amount ?? 0); return (
Account No
{accountNo}