<?php $__env->startSection('main-content'); ?>
<div class="max-w-7xl mx-auto pb-20">
    <div class="flex justify-between items-end mb-8 border-b border-slate-900 pb-4">
        <div>
            <h1 class="text-3xl font-black text-slate-900">Exchange Rates</h1>
            <p class="text-[10px] font-bold text-slate-400 mt-1 font-sans">Daily currency conversion rates relative to ZMW</p>
        </div>
        <div class="flex gap-3">
            <form action="<?php echo e(route('currency-rates.sync')); ?>" method="POST">
                <?php echo csrf_field(); ?>
                <button type="submit" class="text-[10px] font-black text-slate-900 border border-slate-900 px-6 py-3 hover:bg-slate-50 transition">
                    <i class="fas fa-sync-alt mr-2"></i> Sync Latest Rates
                </button>
            </form>
        </div>
    </div>

    <div class="bg-white border border-slate-200 rounded-sm shadow-sm overflow-hidden">
        <table class="w-full">
            <thead class="bg-slate-50 border-b border-slate-200">
                <tr class="text-[10px] font-black text-slate-500 text-left">
                    <th class="px-6 py-4">Date</th>
                    <th class="px-6 py-4">Base</th>
                    <th class="px-6 py-4">Target Currency</th>
                    <th class="px-6 py-4">Exchange Rate</th>
                    <th class="px-6 py-4 text-right">Source</th>
                </tr>
            </thead>
            <tbody class="divide-y divide-slate-100 text-sm">
                <?php $__empty_1 = true; $__currentLoopData = $rates; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rate): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr class="hover:bg-slate-50 transition">
                    <td class="px-6 py-4 font-bold text-slate-900"><?php echo e(\Carbon\Carbon::parse($rate->rate_date)->format('M d, Y')); ?></td>
                    <td class="px-6 py-4 text-slate-500"><?php echo e($rate->baseCurrency->code ?? 'ZMW'); ?></td>
                    <td class="px-6 py-4 font-medium text-slate-900">
                        <?php echo e($rate->targetCurrency->code); ?> — <?php echo e($rate->targetCurrency->name); ?>

                    </td>
                    <td class="px-6 py-4 font-mono font-bold text-indigo-600">
                        1 <?php echo e($rate->baseCurrency->code ?? 'ZMW'); ?> = <?php echo e(number_format($rate->rate, 4)); ?> <?php echo e($rate->targetCurrency->code); ?>

                    </td>
                    <td class="px-6 py-4 text-right text-[10px] text-slate-400 font-bold uppercase">
                        API Automated
                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr>
                    <td colspan="5" class="px-6 py-10 text-center text-slate-400">No exchange rates recorded yet. Click Sync to fetch today's rates.</td>
                </tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
    <div class="mt-4">
        <?php echo e($rates->links()); ?>

    </div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.aura-main', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/edugfqvw/auraaccountify.online/portal/resources/views/currency-rates/index.blade.php ENDPATH**/ ?>