"use client"; import { BadgeDollarSign, Clipboard, ClipboardCheck, Loader2, } from "lucide-react"; import { useState } from "react"; import { toast } from "sonner"; import { verifyTopupPayment } from "@/actions/payment"; import { Table, TableBody, TableCaption, TableCell, TableFooter, TableRow, } from "@/components/ui/table"; import type { Topup } from "@/lib/backend-types"; import { Button } from "./ui/button"; export default function TopupToPay({ topup, disabled }: { topup?: Topup, disabled?: boolean }) { const [verifyingTransferPayment, setVerifyingTransferPayment] = useState(false); return (

Please send the following amount to the payment address

{topup?.paid ? ( ) : (
)}
Topup created at {new Date(topup?.created_at ?? "").toLocaleDateString("en-US", { month: "short", day: "2-digit", year: "numeric", minute: "2-digit", hour: "2-digit", second: "2-digit", })} Topup expires at {new Date(topup?.expires_at ?? "").toLocaleDateString("en-US", { month: "short", day: "2-digit", year: "numeric", minute: "2-digit", hour: "2-digit", second: "2-digit", })} MIB Reference {topup?.mib_reference ? topup.mib_reference : "N/A"} Total Due {topup?.amount?.toFixed(2)}
); } function AccountInfomation({ accountNo, accName, }: { accountNo: string; accName: string; }) { const [accNo, setAccNo] = useState(false); return (
Account Information
Account Name
{accName}

Account No

{accountNo}
); }