<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
    <div class="py-12 bg-gray-50 min-h-screen">
        <div class="max-w-6xl mx-auto sm:px-6 lg:px-8 space-y-6">
            
            <!-- Header Section -->
            <div class="bg-white p-8 rounded-2xl border border-gray-100 shadow-sm">
                <h2 class="text-2xl font-black text-gray-800 uppercase tracking-tight">Daftar Pengiriman</h2>
                <p class="text-sm text-gray-400 font-medium mt-1">Mengelola pesanan yang sedang dalam proses pengiriman.</p>
            </div>

            <!-- Table Card -->
            <div class="bg-white shadow-sm rounded-2xl border border-gray-100 overflow-hidden">
                <div class="overflow-x-auto">
                    <table class="w-full text-left">
                        <thead class="bg-gray-50 border-b border-gray-100 text-gray-400">
                            <tr>
                                <th class="px-8 py-4 text-[10px] font-black uppercase tracking-widest">Kode</th>
                                <th class="px-4 py-4 text-[10px] font-black uppercase tracking-widest">Mitra</th>
                                <th class="px-4 py-4 text-[10px] font-black uppercase tracking-widest">Tgl Pesan</th>
                                <th class="px-4 py-4 text-[10px] font-black uppercase tracking-widest">Tgl Kirim</th>
                                <th class="px-4 py-4 text-[10px] font-black uppercase tracking-widest text-center">Status</th>
                                <th class="px-4 py-4 text-[10px] font-black uppercase tracking-widest text-center">Konfirmasi</th>
                                <th class="px-8 py-4 text-[10px] font-black uppercase tracking-widest text-right">Aksi</th>
                            </tr>
                        </thead>
                        <tbody class="divide-y divide-gray-100">
                            <?php $__empty_1 = true; $__currentLoopData = $pesanans; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $p): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                <tr class="hover:bg-gray-50/50 transition-colors">
                                    <td class="px-8 py-5 font-black text-gray-800 text-sm">#<?php echo e($p->kode_pesanan); ?></td>
                                    <td class="px-4 py-5 font-bold text-gray-700 text-sm"><?php echo e($p->user->name); ?></td>
                                    <td class="px-4 py-5 text-xs font-bold text-gray-500"><?php echo e($p->created_at->format('d/m/Y')); ?></td>
                                    <td class="px-4 py-5 text-xs font-bold text-gray-500"><?php echo e($p->tanggal_kirim ? \Carbon\Carbon::parse($p->tanggal_kirim)->format('d/m/Y') : '-'); ?></td>
                                    
                                    <!-- Status Badge -->
                                    <td class="px-4 py-5 text-center">
                                        <span class="inline-block text-[10px] font-black px-3 py-1 rounded-lg uppercase tracking-widest
                                            <?php echo e($p->status == 'dikirim' ? 'bg-yellow-50 text-yellow-600 border border-yellow-100' : ''); ?>

                                            <?php echo e($p->status == 'selesai' ? 'bg-green-50 text-green-600 border border-green-100' : ''); ?>">
                                            <?php echo e($p->status); ?>

                                        </span>
                                    </td>

                                    <!-- Konfirmasi Selesai -->
                                    <td class="px-4 py-5 text-center">
                                    <form action="<?php echo e(route('admin.pengiriman.updateStatus', $p->id)); ?>" method="POST">
                                        <?php echo csrf_field(); ?> 
                                        <?php echo method_field('PATCH'); ?>
                                        <input type="hidden" name="status" value="selesai">
                                        
                                        <button type="submit" 
                                            class="bg-green-600 text-white text-[10px] font-bold px-4 py-1 rounded-full uppercase hover:bg-green-700 transition-all shadow-sm active:scale-95">
                                            Konfirmasi Selesai
                                        </button>
                                    </form>
                                    </td>
                                    
                                    <td class="px-8 py-5 text-right">
                                        <a href="<?php echo e(route('pesanan.show', $p->id)); ?>" class="text-green-700 font-black text-xs hover:underline uppercase tracking-widest">Detail</a>
                                    </td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                <tr>
                                    <td colspan="7" class="p-12 text-center text-gray-400 font-medium italic">Tidak ada pengiriman aktif.</td>
                                </tr>
                            <?php endif; ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?><?php /**PATH D:\TempeZhi\resources\views/pengiriman/index.blade.php ENDPATH**/ ?>