<?php $__env->startSection('content'); ?>
<div class="row g-4">
    <div class="col-lg-4">
        <div class="card">
            <div class="card-body">
                <h1 class="h4 mb-3">Add Currency</h1>
                <form method="POST" action="<?php echo e(route('currencies.store')); ?>">
                    <?php echo csrf_field(); ?>
                    <div class="mb-3">
                        <label class="form-label" for="code">Code</label>
                        <input class="form-control text-uppercase" id="code" name="code" placeholder="USD" maxlength="10" value="<?php echo e(old('code')); ?>" required>
                    </div>
                    <div class="mb-3">
                        <label class="form-label" for="name">Name</label>
                        <input class="form-control" id="name" name="name" placeholder="US Dollar" value="<?php echo e(old('name')); ?>" required>
                    </div>
                    <button class="btn btn-primary" type="submit">Add Currency</button>
                </form>
            </div>
        </div>
    </div>

    <div class="col-lg-8">
        <div class="card">
            <div class="card-body">
                <h2 class="h4 mb-3">Currencies</h2>
                <div class="table-responsive">
                    <table class="table table-striped align-middle">
                        <thead>
                            <tr>
                                <th>Code</th>
                                <th>Name</th>
                                <th class="text-end">Stock</th>
                                <th class="text-end">Avg Buy Rate</th>
                                <th></th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $__empty_1 = true; $__currentLoopData = $currencies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $currency): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                <tr>
                                    <td class="fw-semibold"><?php echo e($currency->code); ?></td>
                                    <td><?php echo e($currency->name); ?></td>
                                    <td class="text-end"><?php echo e(number_format((float) optional($currency->stock)->quantity, 4)); ?></td>
                                    <td class="text-end"><?php echo e(number_format((float) optional($currency->stock)->avg_buy_rate, 4)); ?></td>
                                    <td class="text-end"><a class="btn btn-outline-primary btn-sm" href="<?php echo e(route('currencies.edit', $currency)); ?>">Edit</a></td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                <tr>
                                    <td class="text-muted text-center" colspan="5">No currencies added yet.</td>
                                </tr>
                            <?php endif; ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH F:\christopher\currencychanger\resources\views/currencies/index.blade.php ENDPATH**/ ?>