<div class="px-4 pt-3">

    
    <div class="flex gap-2 overflow-x-auto pb-1 -mx-4 px-4 scrollbar-hide mb-4">
        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $statusTabs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value => $label): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <?php if (isset($component)) { $__componentOriginalfda6575b25d0d12e8bb6e883624b9441 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalfda6575b25d0d12e8bb6e883624b9441 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.store.filter-chip','data' => ['active' => $filterStatus === $value,'wire:click' => '$set(\'filterStatus\', \''.e($value).'\')']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('store.filter-chip'); ?>
<?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(['active' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($filterStatus === $value),'wire:click' => '$set(\'filterStatus\', \''.e($value).'\')']); ?>
                <?php echo e($label); ?>

             <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalfda6575b25d0d12e8bb6e883624b9441)): ?>
<?php $attributes = $__attributesOriginalfda6575b25d0d12e8bb6e883624b9441; ?>
<?php unset($__attributesOriginalfda6575b25d0d12e8bb6e883624b9441); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalfda6575b25d0d12e8bb6e883624b9441)): ?>
<?php $component = $__componentOriginalfda6575b25d0d12e8bb6e883624b9441; ?>
<?php unset($__componentOriginalfda6575b25d0d12e8bb6e883624b9441); ?>
<?php endif; ?>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
    </div>

    
    <div wire:loading.flex wire:target="filterStatus"
         class="items-center justify-center gap-2 py-8 text-slate-400">
        <svg class="animate-spin w-5 h-5 text-orange-400" fill="none" viewBox="0 0 24 24">
            <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"/>
            <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"/>
        </svg>
    </div>

    <div wire:loading.remove wire:target="filterStatus">

        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($orders->isEmpty()): ?>
            <div class="py-16 flex flex-col items-center text-center">
                <div class="w-16 h-16 bg-slate-100 rounded-full flex items-center justify-center mb-3">
                    <svg class="w-8 h-8 text-slate-300" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"
                              d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"/>
                    </svg>
                </div>
                <p class="font-semibold text-slate-600 text-sm">Belum ada pesanan</p>
                <p class="text-xs text-slate-400 mt-1 mb-5">
                    <?php echo e($filterStatus ? 'Tidak ada pesanan dengan status ini.' : 'Yuk mulai belanja!'); ?>

                </p>
                <a href="<?php echo e(route('store.products')); ?>"
                   class="h-11 px-6 inline-flex items-center justify-center bg-orange-500 hover:bg-orange-600
                          text-white text-sm font-semibold rounded-xl shadow-sm shadow-orange-200
                          active:scale-95 transition-all">
                    Mulai Belanja
                </a>
            </div>

        <?php else: ?>
            <div class="space-y-3">
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $orders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $order): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php
                        // Status Pesanan — warna biru/slate (bukan orange agar beda dengan payment)
                        $statusColors = [
                            'pending'    => 'bg-slate-50 text-slate-600 border-slate-200',
                            'paid'       => 'bg-blue-50 text-blue-700 border-blue-200',
                            'processing' => 'bg-indigo-50 text-indigo-700 border-indigo-200',
                            'delivering' => 'bg-cyan-50 text-cyan-700 border-cyan-200',
                            'completed'  => 'bg-teal-50 text-teal-700 border-teal-200',
                            'cancelled'  => 'bg-slate-100 text-slate-500 border-slate-200',
                        ];
                        $statusClass = $statusColors[$order->status->value] ?? 'bg-slate-50 text-slate-600 border-slate-200';

                        // Status Pembayaran — hijau/merah/kuning (jelas menunjukkan kondisi uang)
                        $paymentColors = [
                            'pending'  => 'text-amber-600',
                            'verified' => 'text-green-600',
                            'rejected' => 'text-red-600',
                        ];
                        $paymentClass = $paymentColors[$order->payment?->status->value ?? 'pending'] ?? 'text-slate-400';
                    ?>

                    <a href="<?php echo e(route('store.orders.show', $order->order_number)); ?>"
                       class="block bg-white rounded-xl border border-slate-100 shadow-sm p-4
                              hover:border-orange-200 hover:shadow-md active:scale-[0.99]
                              transition-all duration-200">

                        
                        <div class="flex items-start justify-between gap-2 mb-2">
                            <div>
                                <p class="text-sm font-bold text-slate-800"><?php echo e($order->order_number); ?></p>
                                <p class="text-xs text-slate-400 mt-0.5">
                                    <?php echo e($order->created_at->translatedFormat('d M Y, H:i')); ?>

                                </p>
                            </div>
                            <span class="shrink-0 text-[11px] font-semibold px-2 py-0.5 rounded-full border <?php echo e($statusClass); ?>">
                                <?php echo e($order->status->label()); ?>

                            </span>
                        </div>

                        
                        <div class="flex items-center justify-between">
                            <p class="text-xs text-slate-500">
                                <?php echo e($order->items_count); ?> produk
                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($order->payment): ?>
                                    · Pembayaran:
                                    <span class="<?php echo e($paymentClass); ?> font-medium">
                                        <?php echo e($order->payment->status->label()); ?>

                                    </span>
                                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                            </p>
                            <p class="text-sm font-bold text-orange-500">
                                Rp <?php echo e(number_format($order->grand_total, 0, ',', '.')); ?>

                            </p>
                        </div>
                    </a>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            </div>
        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

    </div>
</div>
<?php /**PATH C:\laragon\www\titipin-babe\resources\views/livewire/store/orders.blade.php ENDPATH**/ ?>