
<?php $__env->startSection('title', $title); ?>
<?php $__env->startSection('content'); ?>

<div class="space-y-6">

    <!-- Alert Messages -->
    <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.danger-alert','data' => []]); ?>
<?php $component->withName('danger-alert'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
    <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.success-alert','data' => []]); ?>
<?php $component->withName('success-alert'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>

    <!-- Page Header -->
    <div class="flex items-center justify-between">
        <div>
            <h1 class="text-2xl md:text-3xl font-bold text-[#0D1B23] mb-1">Swap History</h1>
            <p class="text-[#7A7A7A] text-sm">View all your crypto swap transactions.</p>
        </div>
        <a href="<?php echo e(route('assetbalance')); ?>" class="px-4 py-2 bg-primary-600 hover:bg-primary-500 rounded-lg text-sm text-white transition-colors">
            <i data-lucide="arrow-right-left" class="w-4 h-4 inline-block mr-1"></i> Swap
        </a>
    </div>

    <!-- History Table -->
    <div class="bg-white rounded-xl border border-[#E0E5E5] overflow-hidden">
        <?php if(count($transactions) > 0): ?>
        <div class="overflow-x-auto">
            <table class="w-full text-sm">
                <thead>
                    <tr class="border-b border-[#E0E5E5]">
                        <th class="text-left px-4 py-3 text-xs uppercase tracking-wider font-semibold text-[#7A7A7A]">From</th>
                        <th class="text-left px-4 py-3 text-xs uppercase tracking-wider font-semibold text-[#7A7A7A]">To</th>
                        <th class="text-right px-4 py-3 text-xs uppercase tracking-wider font-semibold text-[#7A7A7A]">Amount Sent</th>
                        <th class="text-right px-4 py-3 text-xs uppercase tracking-wider font-semibold text-[#7A7A7A]">Received</th>
                        <th class="text-center px-4 py-3 text-xs uppercase tracking-wider font-semibold text-[#7A7A7A]">Status</th>
                        <th class="text-right px-4 py-3 text-xs uppercase tracking-wider font-semibold text-[#7A7A7A]">Date</th>
                    </tr>
                </thead>
                <tbody class="divide-y divide-[#E0E5E5]">
                    <?php $__currentLoopData = $transactions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $swap): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr class="hover:bg-[#DFE5E5]/20 transition-colors">
                        <td class="px-4 py-3">
                            <span class="inline-flex items-center px-2 py-1 rounded-md bg-[#DFE5E5] text-xs font-semibold text-[#0D1B23]">
                                <?php echo e(strtoupper($swap->source)); ?>

                            </span>
                        </td>
                        <td class="px-4 py-3">
                            <span class="inline-flex items-center px-2 py-1 rounded-md bg-[#DFE5E5] text-xs font-semibold text-[#0D1B23]">
                                <?php echo e(strtoupper($swap->dest)); ?>

                            </span>
                        </td>
                        <td class="px-4 py-3 text-right text-[#4A4A4A] font-medium">
                            <?php echo e($swap->source === 'usd' ? number_format($swap->amount, 2) : number_format($swap->amount, 8)); ?> <?php echo e(strtoupper($swap->source)); ?>

                        </td>
                        <td class="px-4 py-3 text-right text-[#0D1B23] font-semibold">
                            <?php echo e($swap->dest === 'usd' ? number_format($swap->quantity, 2) : number_format($swap->quantity, 8)); ?> <?php echo e(strtoupper($swap->dest)); ?>

                        </td>
                        <td class="px-4 py-3 text-center">
                            <span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium
                                <?php echo e(($swap->status ?? 'completed') === 'completed' ? 'bg-[#28A745]/10 text-[#28A745]' : 'bg-[#EBBC46]/10 text-[#EBBC46]'); ?>">
                                <?php echo e(ucfirst($swap->status ?? 'completed')); ?>

                            </span>
                        </td>
                        <td class="px-4 py-3 text-right text-[#7A7A7A] text-xs">
                            <?php echo e(\Carbon\Carbon::parse($swap->created_at)->format('M d, Y H:i')); ?>

                        </td>
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
        </div>
        <div class="p-4 border-t border-[#E0E5E5]">
            <?php echo e($transactions->links()); ?>

        </div>
        <?php else: ?>
        <div class="p-12 text-center">
            <div class="w-16 h-16 mx-auto mb-4 rounded-full bg-[#DFE5E5] flex items-center justify-center">
                <i data-lucide="arrow-right-left" class="w-8 h-8 text-[#7A7A7A]"></i>
            </div>
            <h3 class="text-lg text-[#4A4A4A] font-semibold mb-1">No Swap History</h3>
            <p class="text-sm text-[#7A7A7A] mb-4">You haven't made any crypto swaps yet.</p>
            <a href="<?php echo e(route('assetbalance')); ?>" class="inline-block px-5 py-2.5 bg-primary-600 hover:bg-primary-500 rounded-lg text-sm text-white transition-colors">
                Start Swapping
            </a>
        </div>
        <?php endif; ?>
    </div>
</div>

<script>
    document.addEventListener('DOMContentLoaded', () => { setTimeout(() => lucide.createIcons(), 100); });
</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.bankapp', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/swizzfx/fintech.swizzfx.pro/resources/views/user/swap-history.blade.php ENDPATH**/ ?>