

<?php $__env->startSection('title', 'Orders'); ?>
<?php $__env->startSection('meta_description', 'Your orders – ' . ($store_name ?? config('app.name'))); ?>

<?php $__env->startSection('content'); ?>
<div class="max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-6">
    <h1 class="text-2xl font-bold text-gray-800 mb-6">Order History</h1>

    <?php if($orders->isEmpty()): ?>
    <div class="card p-12 text-center">
        <i class="fas fa-box-open text-5xl text-gray-300 mb-4"></i>
        <p class="text-gray-600 mb-4">You have no orders yet.</p>
        <a href="<?php echo e(route('products.index')); ?>" class="btn-primary inline-block">Shop Now</a>
    </div>
    <?php else: ?>
    <div class="space-y-4">
        <?php $__currentLoopData = $orders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $order): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <a href="<?php echo e(route('orders.show', $order)); ?>" class="card p-6 block hover:shadow-card-hover transition">
            <div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
                <div>
                    <p class="font-bold text-gray-800">#<?php echo e($order->order_number); ?></p>
                    <p class="text-sm text-gray-500 mt-1"><?php echo e($order->created_at->format('M j, Y g:i A')); ?></p>
                    <span class="inline-block mt-2 px-3 py-0.5 rounded-full text-xs font-medium
                        <?php if($order->status === 'pending'): ?> bg-amber-100 text-amber-800
                        <?php elseif($order->status === 'paid'): ?> bg-blue-100 text-blue-800
                        <?php elseif($order->status === 'shipped'): ?> bg-indigo-100 text-indigo-800
                        <?php elseif($order->status === 'delivered'): ?> bg-green-100 text-green-800
                        <?php elseif($order->status === 'cancelled'): ?> bg-red-100 text-red-800
                        <?php else: ?> bg-gray-100 text-gray-800 <?php endif; ?>">
                        <?php echo e(ucfirst($order->status)); ?>

                    </span>
                </div>
                <div class="text-left sm:text-right">
                    <p class="font-bold text-primary-dark"><?php echo e($currency_symbol); ?><?php echo e(number_format($order->total, 0)); ?></p>
                    <p class="text-sm text-gray-500"><?php echo e($order->items->count()); ?> item(s)</p>
                </div>
            </div>
        </a>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>
    <div class="mt-8">
        <?php echo e($orders->links()); ?>

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

<?php echo $__env->make('store.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\laragon\www\ReactNative\grocery-api\resources\views/store/orders/index.blade.php ENDPATH**/ ?>