<?php $__env->startSection('title', 'Comptes'); ?>
<?php $__env->startSection('content'); ?>
<div class="d-flex justify-content-between align-items-center mb-3">
    <h3>Comptes (admin / coursiers)</h3>
    <a href="<?php echo e(route('admin.users.create')); ?>" class="btn btn-primary">+ Nouveau compte</a>
</div>

<div class="card p-3">
    <div class="table-responsive">
        <table class="table align-middle">
            <thead>
                <tr>
                    <th>Nom</th>
                    <th>Email</th>
                    <th>Role</th>
                    <th>Partenaire</th>
                    <th>Statut</th>
                    <th></th>
                </tr>
            </thead>
            <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $u): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr>
                    <td><?php echo e($u->name); ?></td>
                    <td><?php echo e($u->email); ?></td>
                    <td><span class="badge bg-info text-dark"><?php echo e($u->role); ?></span></td>
                    <td><?php echo e($u->partner->name ?? '-'); ?></td>
                    <td>
                        <span class="badge <?php echo e($u->active ? 'bg-success' : 'bg-secondary'); ?>">
                            <?php echo e($u->active ? 'Actif' : 'Inactif'); ?>

                        </span>
                    </td>
                    <td class="table-actions">
                        <form action="<?php echo e(route('admin.users.toggle', $u)); ?>" method="POST">
                            <?php echo csrf_field(); ?>
                            <button class="btn btn-sm btn-outline-secondary">
                                <?php echo e($u->active ? 'Desactiver' : 'Activer'); ?>

                            </button>
                        </form>
                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr><td colspan="6" class="text-center text-muted">Aucun compte.</td></tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
    <?php echo e($users->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/admin/users/index.blade.php ENDPATH**/ ?>