<?php $__env->startSection('content'); ?>
    <div class="page-container">

        <div class="page-title-head d-flex align-items-sm-center flex-sm-row flex-column gap-2">
            <div class="flex-grow-1">
                <h4 class="fs-18 fw-semibold mb-0"><?php echo e($title); ?></h4>
            </div>

            <div class="text-end">
                <?php if (isset($component)) { $__componentOriginalf249638ac7504c50bf0259c0cb71919d = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalf249638ac7504c50bf0259c0cb71919d = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dashboard.user.breadcrumbs','data' => ['breadcrumbs' => $breadcrumbs]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dashboard.user.breadcrumbs'); ?>
<?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(['breadcrumbs' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($breadcrumbs)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalf249638ac7504c50bf0259c0cb71919d)): ?>
<?php $attributes = $__attributesOriginalf249638ac7504c50bf0259c0cb71919d; ?>
<?php unset($__attributesOriginalf249638ac7504c50bf0259c0cb71919d); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalf249638ac7504c50bf0259c0cb71919d)): ?>
<?php $component = $__componentOriginalf249638ac7504c50bf0259c0cb71919d; ?>
<?php unset($__componentOriginalf249638ac7504c50bf0259c0cb71919d); ?>
<?php endif; ?>
            </div>
        </div>

        <div class="row">
            <div class="col-xl-12 col-lg-12">
                <?php if (isset($component)) { $__componentOriginal66cb34fa521ca32c539059e04f66064d = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal66cb34fa521ca32c539059e04f66064d = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.dashboard.user.card','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('dashboard.user.card'); ?>
<?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([]); ?>
                    <?php $__env->slot('header'); ?>
                        Transaction History
                    <?php $__env->endSlot(); ?>

                    
                    <div class="table-responsive d-none d-lg-block">
                        <table id="myTable" class="table table-bordered">
                            <thead>
                                <tr>
                                    <th>#</th>
                                    <th>Reference ID</th>
                                    <th>Type</th>
                                    <th>Description</th>
                                    <th>Amount</th>
                                    <th>Balance</th>
                                    <th>Date</th>
                                    <th>Status</th>
                                    <th>Action</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $__currentLoopData = $transactions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $transaction): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td><?php echo e($loop->iteration); ?></td>
                                        <td><?php echo e($transaction->reference_id); ?></td>
                                        <td><?php echo e($transaction->type->label()); ?></td>
                                        <td><?php echo e($transaction->description); ?></td>
                                        <td>
                                            <?php if($transaction->isDirectionCredit()): ?>
                                                <span
                                                    class="text-success">+<?php echo e(currency($user->currency)); ?><?php echo e(formatAmount($transaction->amount)); ?></span>
                                            <?php else: ?>
                                                <span
                                                    class="text-danger">-<?php echo e(currency($user->currency)); ?><?php echo e(formatAmount($transaction->amount)); ?></span>
                                            <?php endif; ?>
                                        </td>
                                        <td><?php echo e(currency($user->currency)); ?><?php echo e(formatAmount($transaction->current_balance)); ?>

                                        </td>
                                        <td><?php echo e(formatDateTime($transaction->transaction_at)); ?></td>
                                        <td>
                                            <span class="<?php echo e($transaction->status->badge()); ?>">
                                                <?php echo e($transaction->status->label()); ?>

                                            </span>
                                        </td>
                                        <td>
                                            <a href="<?php echo e(route('user.transaction.show', $transaction->uuid)); ?>"
                                                class="btn btn-warning btn-sm">
                                                <i class="ti ti-eye me-1"></i>View
                                            </a>
                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                    </div>

                    
                    <div class="d-lg-none">
                        <?php $__currentLoopData = $transactions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $transaction): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <div class="txn-card-item border rounded-3 p-3 mb-3">

                                
                                <div class="d-flex justify-content-between align-items-start mb-2">
                                    <div class="d-flex align-items-center gap-2">
                                        <span class="txn-index-badge">#<?php echo e($loop->iteration); ?></span>
                                        <span class="text-muted"
                                            style="font-size:.75rem;"><?php echo e($transaction->type->label()); ?></span>
                                    </div>
                                    <span class="<?php echo e($transaction->status->badge()); ?> rounded-pill px-3 py-1"
                                        style="font-size:.7rem;">
                                        <?php echo e($transaction->status->label()); ?>

                                    </span>
                                </div>

                                
                                <div class="d-flex justify-content-between align-items-center mb-3">
                                    <div>
                                        <?php if($transaction->isDirectionCredit()): ?>
                                            <span class="fs-5 fw-bold text-success">
                                                +<?php echo e(currency($user->currency)); ?><?php echo e(formatAmount($transaction->amount)); ?>

                                            </span>
                                        <?php else: ?>
                                            <span class="fs-5 fw-bold text-danger">
                                                -<?php echo e(currency($user->currency)); ?><?php echo e(formatAmount($transaction->amount)); ?>

                                            </span>
                                        <?php endif; ?>
                                    </div>
                                    <div class="text-end">
                                        <p class="text-muted mb-0"
                                            style="font-size:.68rem;font-weight:500;letter-spacing:.06em;text-transform:uppercase;">
                                            Balance After</p>
                                        <span class="fw-semibold" style="font-family:monospace;font-size:.85rem;">
                                            <?php echo e(currency($user->currency)); ?><?php echo e(formatAmount($transaction->current_balance)); ?>

                                        </span>
                                    </div>
                                </div>

                                
                                <div class="d-flex justify-content-between align-items-center pt-2 border-top mb-3">
                                    <div>
                                        <p class="text-muted mb-0"
                                            style="font-size:.68rem;font-weight:500;letter-spacing:.06em;text-transform:uppercase;">
                                            Reference</p>
                                        <span
                                            style="font-family:monospace;font-size:.78rem;"><?php echo e($transaction->reference_id); ?></span>
                                    </div>
                                    <div class="text-end">
                                        <p class="text-muted mb-0"
                                            style="font-size:.68rem;font-weight:500;letter-spacing:.06em;text-transform:uppercase;">
                                            Date</p>
                                        <span
                                            style="font-size:.8rem;"><?php echo e(formatDateTime($transaction->transaction_at)); ?></span>
                                    </div>
                                </div>

                                
                                <?php if($transaction->description): ?>
                                    <p class="text-muted mb-3" style="font-size:.82rem;">
                                        <i class="bi bi-chat-left-text me-1"></i><?php echo e($transaction->description); ?>

                                    </p>
                                <?php endif; ?>

                                
                                <a href="<?php echo e(route('user.transaction.show', $transaction->uuid)); ?>"
                                    class="btn btn-warning btn-sm w-100 d-inline-flex align-items-center justify-content-center gap-1">
                                    <i class="ti ti-eye"></i> View Transaction
                                </a>

                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>

                 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal66cb34fa521ca32c539059e04f66064d)): ?>
<?php $attributes = $__attributesOriginal66cb34fa521ca32c539059e04f66064d; ?>
<?php unset($__attributesOriginal66cb34fa521ca32c539059e04f66064d); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal66cb34fa521ca32c539059e04f66064d)): ?>
<?php $component = $__componentOriginal66cb34fa521ca32c539059e04f66064d; ?>
<?php unset($__componentOriginal66cb34fa521ca32c539059e04f66064d); ?>
<?php endif; ?>

                <style>
                    .txn-card-item {
                        /* background: #fff; */
                        transition: box-shadow .15s;
                    }

                    .txn-card-item:hover {
                        box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
                    }

                    .txn-index-badge {
                        font-size: .72rem;
                        font-weight: 700;
                        background: #f1f3f5;
                        color: #6c757d;
                        border-radius: 6px;
                        padding: 2px 7px;
                    }
                </style>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('dashboard.user.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\projects\online-banking-v7.3-seacoast-bank\resources\views/dashboard/user/transaction/index.blade.php ENDPATH**/ ?>