<?php $__env->startSection('title', $typeLabel); ?>
<?php $__env->startSection('content'); ?>
<div class="d-flex justify-content-between align-items-center mb-3">
    <h3><?php echo e($typeLabel); ?></h3>
    <a href="<?php echo e(route('partner.requests.create', $type)); ?>" class="btn btn-primary">+ Nouvelle demande</a>
</div>

<div class="card p-3">
    <div class="table-responsive">
        <table class="table align-middle">
            <thead>
                <tr>
                    <th>#</th>
                    <th>Statut</th>
                    <th>Urgence</th>
                    <th>Qte demandee</th>
                    <th>Qte collectee</th>
                    <th>Cree le</th>
                </tr>
            </thead>
            <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $requests; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $r): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr class="<?php echo e($r->status === 'ecart' ? 'table-danger' : ''); ?>">
                    <td><?php echo e($r->id); ?></td>
                    <td><span class="badge <?php echo e($r->status === 'ecart' ? 'badge-ecart' : 'bg-secondary'); ?>"><?php echo e(\App\Models\ServiceRequest::statuses()[$r->status]); ?></span></td>
                    <td><?php echo e($r->urgency === 'urgent' ? 'Urgent' : 'Normal'); ?></td>
                    <td><?php echo e($r->requested_quantity ?? '-'); ?></td>
                    <td><?php echo e($r->collected_quantity ?? '-'); ?></td>
                    <td><?php echo e($r->created_at->format('d/m/Y H:i')); ?></td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr><td colspan="6" class="text-center text-muted">Aucune demande dans cette categorie.</td></tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
    <?php echo e($requests->links()); ?>

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

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