<?php $__env->startSection('title', 'Admin users'); ?>

<?php $__env->startSection('content'); ?>
<div class="pg-head">
    <div>
        <h1>Admin users</h1>
        <p>Super Admin accounts for <?php echo e(config('mexco.apps.super.name')); ?>.</p>
    </div>
    <a href="<?php echo e(route('mexco.super.admins.create')); ?>" class="btn-purple">+ Add admin</a>
</div>

<div class="card">
    <div class="tbl-wrap">
        <table class="data-tbl">
            <thead>
                <tr>
                    <th>Name</th>
                    <th>Email</th>
                    <th>Status</th>
                    <th>Last login</th>
                    <th style="text-align:right">Actions</th>
                </tr>
            </thead>
            <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $admins; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $admin): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr>
                        <td class="cell-name"><?php echo e($admin->name); ?></td>
                        <td><?php echo e($admin->email); ?></td>
                        <td>
                            <span class="status-pill <?php echo e($admin->isActive() ? 'success' : 'muted'); ?>">
                                <?php echo e($admin->isActive() ? 'Active' : 'Suspended'); ?>

                            </span>
                        </td>
                        <td class="cell-sub"><?php echo e($admin->last_login_at?->format('d M Y, H:i') ?? 'Never'); ?></td>
                        <td>
                            <div class="action-group">
                                <a href="<?php echo e(route('mexco.super.admins.edit', $admin)); ?>" class="btn-outline btn-sm">Edit</a>
                                <?php if($admin->isActive() && $admin->id !== session('meetup_super_admin_id')): ?>
                                    <form method="POST" action="<?php echo e(route('mexco.super.admins.suspend', $admin)); ?>" style="display:inline">
                                        <?php echo csrf_field(); ?>
                                        <button type="submit" class="btn-danger btn-sm" onclick="return confirm('Suspend this admin?')">Suspend</button>
                                    </form>
                                <?php elseif(! $admin->isActive()): ?>
                                    <form method="POST" action="<?php echo e(route('mexco.super.admins.activate', $admin)); ?>" style="display:inline">
                                        <?php echo csrf_field(); ?>
                                        <button type="submit" class="btn-outline btn-sm">Activate</button>
                                    </form>
                                <?php endif; ?>
                            </div>
                        </td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr><td colspan="5" class="text-center cell-sub py-4">No admin users.</td></tr>
                <?php endif; ?>
            </tbody>
        </table>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('super-admin.layout', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\myapp\resources\views/super-admin/admins/index.blade.php ENDPATH**/ ?>