<div class="nk-content nk-content-fluid">
    <div class="container-xl wide-lg">
        <div class="nk-content-body">
                <div class="nk-block-head">
                    <div class="nk-block-between-md g-4">
                        <div class="nk-block-head-content">
                                <h2 class="nk-block-title fw-normal">Pending Transaction</h2>
                                <div class="nk-block-des">
                                    <p class="text-muted">Below is a list of your pending transactions. These are transactions that have been initiated but are not yet completed or approved.</p>
                                </div>
                        </div>
                    </div>
                </div>
                <div class="nk-block nk-block-sm">
                    <div class="card card-bordered shadow-sm">
                        <div class="card-inner">
                            <?php
                            $pendingTransactions = $user->hasPendingTransaction();

                            if (!empty($pendingTransactions)) {
                                foreach ($pendingTransactions as $transaction) { ?>
                                    <div class="transaction-item p-3 mb-3 border rounded bg-light-subtle">
                                        <div class="d-flex justify-content-between align-items-center">
                                            <div class="transaction-details">
                                                <div class="mb-2">
                                                    <span class="badge bg-warning" style="color:black">Pending</span>
                                                    <span class="text-muted ms-2">#<?php echo $transaction->reference; ?></span>
                                                </div>
                                                <h5 class="amount mb-1">$<?php echo number_format($transaction->amount, 2); ?></h5>
                                                <small class="text-muted"><?php echo date('F d, Y H:i', strtotime($transaction->date)); ?></small>
                                            </div>
                                            <div class="transaction-status">
                                                <div class="d-flex align-items-center">
                                                    <span class="rounded-pill px-3">
                                                        <a class="btn btn-primary btn-sm" href="index.php?vat=true">Continue</a>
                                                    </span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                <?php }
                            } else { ?>
                                <div class="text-center py-5">
                                    <i class="fas fa-inbox fa-3x text-muted mb-3"></i>
                                    <h5>No Pending Transactions</h5>
                                    <p class="text-muted">You don't have any pending transactions at the moment.</p>
                                </div>
                            <?php } ?>
                        </div>
                    </div>
                </div>
        </div>
    </div>
</div>