

<?php $__env->startSection('title', 'Wallet'); ?>
<?php $__env->startSection('page_class', 'page-wallet'); ?>

<?php $__env->startSection('content'); ?>
    <div class="page-header">
        <div>
            <h1 class="page-title">Wallet</h1>
            <nav class="breadcrumb">
                <a href="<?php echo e(route('dashboard')); ?>" class="breadcrumb-item">Home</a>
                <span class="breadcrumb-item active">Wallet</span>
            </nav>
        </div>
    </div>

    <?php if($platformNotice ?? null): ?>
        <?php if (isset($component)) { $__componentOriginalaaaa43f3131e74c9e05cf94572c12d21 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalaaaa43f3131e74c9e05cf94572c12d21 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'eliteadmin::components.alert','data' => ['type' => 'info','message' => $platformNotice,'class' => 'mb-4']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('eliteadmin::alert'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['type' => 'info','message' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($platformNotice),'class' => 'mb-4']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalaaaa43f3131e74c9e05cf94572c12d21)): ?>
<?php $attributes = $__attributesOriginalaaaa43f3131e74c9e05cf94572c12d21; ?>
<?php unset($__attributesOriginalaaaa43f3131e74c9e05cf94572c12d21); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalaaaa43f3131e74c9e05cf94572c12d21)): ?>
<?php $component = $__componentOriginalaaaa43f3131e74c9e05cf94572c12d21; ?>
<?php unset($__componentOriginalaaaa43f3131e74c9e05cf94572c12d21); ?>
<?php endif; ?>
    <?php endif; ?>

    <?php if($wallet ?? null): ?>
        <div class="card mb-4">
            <div class="card-body d-flex justify-content-between align-items-center flex-wrap gap-2">
                <div>
                    <div class="text-muted small">Platform Wallet Balance</div>
                    <strong class="fs-4"><?php echo e(platform_money($wallet->balance, $wallet->currency)); ?></strong>
                </div>
                <span class="text-muted small">Managed by Product Owner Platform</span>
            </div>
        </div>
    <?php else: ?>
        <div class="card mb-4">
            <div class="card-body text-center text-muted py-4">
                No wallet balance recorded yet. Module purchases and top-ups from the Product Owner Platform appear here.
            </div>
        </div>
    <?php endif; ?>

    <div class="card">
        <div class="card-header">
            <h5 class="card-title mb-0">Transaction Ledger</h5>
        </div>
        <div class="table-responsive">
            <table class="table table-hover mb-0">
                <thead class="table-light">
                    <tr>
                        <th>Date</th>
                        <th>Type</th>
                        <th>Amount</th>
                        <th class="d-none d-md-table-cell">Opening</th>
                        <th class="d-none d-md-table-cell">Closing</th>
                        <th class="d-none d-lg-table-cell">Reference</th>
                        <th>Description</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $ledger; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $entry): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr>
                            <td><?php echo e($entry->recorded_at->format('M j, Y H:i')); ?></td>
                            <td>
                                <span class="badge bg-<?php echo e($entry->type === 'credit' ? 'success' : 'danger'); ?>">
                                    <?php echo e(ucfirst($entry->type)); ?>

                                </span>
                            </td>
                            <td><?php echo e(platform_money($entry->amount, $entry->currency)); ?></td>
                            <td class="d-none d-md-table-cell"><?php echo e(number_format($entry->opening_balance, 2)); ?></td>
                            <td class="d-none d-md-table-cell"><?php echo e(number_format($entry->closing_balance, 2)); ?></td>
                            <td class="d-none d-lg-table-cell"><code class="small"><?php echo e($entry->reference_number); ?></code></td>
                            <td><?php echo e($entry->description ?? '—'); ?></td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr>
                            <td colspan="7" class="text-center text-muted py-4">
                                No wallet transactions yet. Module purchases and top-ups from the Product Owner Platform appear here.
                            </td>
                        </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
        <?php if($ledger->hasPages()): ?>
            <div class="card-footer">
                <?php echo e($ledger->links()); ?>

            </div>
        <?php endif; ?>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('eliteadmin::layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH D:\RABI\rabi\module-laravel-platform\apps\admin\resources\views/wallet/index.blade.php ENDPATH**/ ?>