<div>
    <div class="w-full flex justify-between items-start">
        <?php
$__split = function ($name, $params = []) {
    return [$name, $params];
};
[$__name, $__params] = $__split('components.section-header', ['title' => 'Usuarios','description' => 'Consulta el listado de usuarios de la plataforma.']);

$key = null;

$key ??= \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::generateKey('lw-4081717686-0', null);

$__html = app('livewire')->mount($__name, $__params, $key);

echo $__html;

unset($__html);
unset($__name);
unset($__params);
unset($__split);
if (isset($__slots)) unset($__slots);
?>
        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.users.create')): ?>
        <a href="<?php echo e(route('users.create')); ?>"
            class="rounded bg-3ip px-4 py-2 text-white hover:bg-3ip-light flex items-center">
            <img src="<?php echo e(asset('vendor/blade-untitledui-icons/plus.svg')); ?>" alt="Logo"
                class="w-6 h-6 mr-2 svg-fill-white">
            Nuevo usuario
        </a>
        <?php endif; ?>
    </div>

    <div class="flex flex-wrap w-full">

        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(session()->has('success')): ?>
            <div class="mb-4 rounded bg-green-100 px-4 py-2 text-green-700">
                <?php echo e(session('success')); ?>

            </div>
        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
        <?php if(session()->has('error')): ?>
            <div class="mb-4 rounded bg-red-100 px-4 py-2 text-red-700">
                <?php echo e(session('error')); ?>

            </div>
        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

        
        <div class="flex items-center justify-between w-full">
            <div class="w-1/3">
                <input type="text" wire:model.live.debounce.500ms="search" placeholder="Buscar"
                    class="w-full rounded-lg border-2 border-gray-200 px-4 py-2">
            </div>
        </div>

        
        <div class="overflow-hidden rounded bg-white w-full mt-4">
            <table class="w-full rounded-xl border-separate border">
                <thead class="text-xs text-gray-600">
                    <tr>
                        <th class="border-b px-4 py-3">ID</th>
                        <th class="border-b px-4 py-3 text-left">Nombre</th>
                        <th class="border-b px-4 py-3 text-left">Email</th>
                        <th class="border-b px-4 py-3 text-left">Rol</th>
                        <th class="border-b px-4 py-3">Última actividad</th>
                        <th class="border-b px-4 py-3">Creado</th>
                        <th class="border-b px-4 py-3">Modificado</th>
                        <th class="border-b px-4 py-3"></th>
                    </tr>
                </thead>

                <tbody class="divide-y">
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__empty_1 = true; $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr wire:key="user-<?php echo e($user->id); ?>">
                            <td class="px-4 py-3 <?php echo e(!$loop->last ? 'border-b' : ''); ?>">
                                <?php echo e($user->id); ?></td>
                            <td class="px-4 py-3 <?php echo e(!$loop->last ? 'border-b' : ''); ?>">
                                <?php echo e($user->name); ?></td>
                            <td class="px-4 py-3 <?php echo e(!$loop->last ? 'border-b' : ''); ?>">
                                <?php echo e($user->email); ?></td>

                            <td class="px-4 py-3 <?php echo e(!$loop->last ? 'border-b' : ''); ?>">
                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $user->roles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $role): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <span class="rounded bg-gray-200 px-2 py-1 text-xs">
                                        <?php echo e($role->name); ?>

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

                            <td
                                class="px-4 py-3 text-center <?php echo e(!$loop->last ? 'border-b' : ''); ?> text-gray-600 text-sm">
                                <?php echo e($user->last_access_at?->format('d/m/Y H:i') ?? '—'); ?>

                            </td>

                            <td
                                class="px-4 py-3 text-center <?php echo e(!$loop->last ? 'border-b' : ''); ?>">
                                <?php echo e($user->created_at->format('Y-m-d')); ?></td>
                            <td
                                class="px-4 py-3 text-center <?php echo e(!$loop->last ? 'border-b' : ''); ?>">
                                <?php echo e($user->updated_at->format('Y-m-d')); ?></td>

                            <td
                                class="px-4 py-3 flex items-center justify-end <?php echo e(!$loop->last ? 'border-b' : ''); ?>">
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.users.edit')): ?>
                                <a href="<?php echo e(route('users.edit', $user)); ?>"
                                    class="mr-2 text-blue-600 hover:text-blue-800">
                                    <img src="<?php echo e(asset('vendor/blade-untitledui-icons/settings.svg')); ?>" alt="Editar"
                                        class="w-6 h-6">
                                </a>
                                <?php endif; ?>

                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('admin.users.destroy')): ?>
                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($user->is_deletable()): ?>
                                    <button wire:click="delete(<?php echo e($user->id); ?>)"
                                        wire:confirm="¿Seguro que deseas borrar este usuario?"
                                        class="text-red-600 hover:text-red-800">
                                        <img src="<?php echo e(asset('vendor/blade-untitledui-icons/trash.svg')); ?>"
                                            alt="Borrar" class="w-6 h-6 svg-fill-red">
                                    </button>
                                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                                <?php endif; ?>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr>
                            <td colspan="8" class="px-4 py-3 text-center text-gray-500">
                                No hay usuarios.
                            </td>
                        </tr>
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    <tr>
                        <td colspan="8" class="px-4 py-3 text-center text-gray-500">
                            <?php echo e($users->links('livewire.components.table-pagination')); ?>

                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</div><?php /**PATH /var/www/html/resources/views/livewire/users/index.blade.php ENDPATH**/ ?>