

<?php $__env->startSection('content'); ?>
    <div class="bg-white shadow rounded p-6">
        <div class="flex justify-between items-center mb-4">
            <h2 class="text-2xl font-bold">User List</h2>
            <a href="<?php echo e(route('new.user')); ?>"
               class="flex items-center bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600 shadow">
                <i class="fas fa-user-plus mr-2"></i>
                <span>Add User</span>
            </a>
        </div>
        <table class="min-w-full divide-y divide-gray-200">
            <thead class="bg-gray-100">
                <tr>
                    <th class="px-6 py-3 text-left text-sm font-medium">ID</th>
                    <th class="px-6 py-3 text-left text-sm font-medium">Name</th>
                    <th class="px-6 py-3 text-left text-sm font-medium">Email</th>
                    <th class="px-6 py-3 text-left text-sm font-medium">Actions</th>
                </tr>
            </thead>
            <tbody class="divide-y divide-gray-100">
                <?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td class="px-6 py-4"><?php echo e($loop->iteration); ?></td>
                        <td class="px-6 py-4"><?php echo e($user->name); ?></td>
                        <td class="px-6 py-4"><?php echo e($user->email); ?></td>
                        <td class="px-6 py-4 flex space-x-2">
                            <?php if(auth()->id() !== $user->id): ?>
                                <a href="<?php echo e(route('edit.user', $user->id)); ?>"
                                class="bg-yellow-500 text-white px-3 py-1 rounded hover:bg-yellow-600 flex items-center">
                                    <i class="fas fa-edit mr-1"></i> Edit
                                </a>

                                <form action="<?php echo e(route('destroy.user', $user->id)); ?>" method="POST"
                                    onsubmit="return confirm('Are you sure you want to delete this admin?');">
                                    <?php echo csrf_field(); ?>
                                    <?php echo method_field('DELETE'); ?>
                                    <button type="submit"
                                            class="bg-red-500 text-white px-3 py-1 rounded hover:bg-red-600 flex items-center">
                                        <i class="fas fa-trash-alt mr-1"></i> Delete
                                    </button>
                                </form>
                            <?php else: ?>
                                <span class="text-gray-500 italic">🙋 It's you</span>
                            <?php endif; ?>
                        </td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
        </table>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH E:\Sw_arif\realState\resources\views/backend/admin/users/list_user.blade.php ENDPATH**/ ?>