<div x-data>

    
    <div class="mb-6">
        <h1 class="text-2xl font-bold text-slate-800">Aktivitas Admin</h1>
        <p class="text-sm text-slate-500 mt-0.5">Riwayat aktivitas seluruh admin di sistem (tidak dapat diubah atau dihapus).</p>
    </div>

    
    <div class="bg-white rounded-xl border border-slate-200 p-4 mb-4">
        <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3">
            <div>
                <label class="block text-xs font-medium text-slate-500 mb-1">Cari Aktivitas</label>
                <div class="relative">
                    <svg class="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"/>
                    </svg>
                    <input wire:model.live.debounce.400ms="search" type="text"
                        placeholder="Cari deskripsi aktivitas..."
                        class="w-full pl-9 pr-3 py-2 border border-slate-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-orange-500" />
                </div>
            </div>
            <div>
                <label class="block text-xs font-medium text-slate-500 mb-1">User</label>
                <select wire:model.live="filterUser"
                    class="w-full px-3 py-2 border border-slate-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-orange-500 bg-white">
                    <option value="">Semua User</option>
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($user->id); ?>"><?php echo e($user->name); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </select>
            </div>
            <div>
                <label class="block text-xs font-medium text-slate-500 mb-1">Modul</label>
                <select wire:model.live="filterModul"
                    class="w-full px-3 py-2 border border-slate-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-orange-500 bg-white">
                    <option value="">Semua Modul</option>
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $modules; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $mod): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($mod); ?>"><?php echo e(ucfirst($mod)); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </select>
            </div>
            <div>
                <label class="block text-xs font-medium text-slate-500 mb-1">Tanggal</label>
                <input wire:model.live="filterTanggal" type="date"
                    class="w-full px-3 py-2 border border-slate-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-orange-500" />
            </div>
        </div>

        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($search || $filterUser || $filterModul || $filterTanggal): ?>
            <div class="mt-3">
                <button type="button" wire:click="resetFilters" class="text-xs text-orange-600 hover:text-orange-700 font-medium">
                    Reset semua filter
                </button>
            </div>
        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
    </div>

    
    <div wire:loading.flex wire:target="search, filterUser, filterModul, filterTanggal, perPage"
        class="items-center gap-2 text-sm text-slate-400 mb-3">
        <svg class="animate-spin w-4 h-4 text-orange-500" fill="none" viewBox="0 0 24 24">
            <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"/>
            <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"/>
        </svg>
        Memuat data...
    </div>

    
    <div class="bg-white rounded-xl border border-slate-200 overflow-hidden" wire:loading.class="opacity-60" wire:target="search, filterUser, filterModul, filterTanggal, perPage">
        <div class="overflow-x-auto">
            <table class="w-full text-sm">
                <thead class="bg-slate-50 border-b border-slate-200">
                    <tr>
                        <th class="text-left px-4 py-3 font-semibold text-slate-600 whitespace-nowrap">Waktu</th>
                        <th class="text-left px-4 py-3 font-semibold text-slate-600 whitespace-nowrap">User</th>
                        <th class="text-left px-4 py-3 font-semibold text-slate-600">Aktivitas</th>
                        <th class="text-left px-4 py-3 font-semibold text-slate-600 whitespace-nowrap">Modul</th>
                        <th class="text-left px-4 py-3 font-semibold text-slate-600 whitespace-nowrap">IP</th>
                        <th class="text-left px-4 py-3 font-semibold text-slate-600 whitespace-nowrap">Browser</th>
                    </tr>
                </thead>
                <tbody class="divide-y divide-slate-100">
                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__empty_1 = true; $__currentLoopData = $activities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $log): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr class="hover:bg-slate-50 transition-colors" wire:key="log-<?php echo e($log->id); ?>">
                            <td class="px-4 py-3 text-slate-600 whitespace-nowrap">
                                <?php echo e($log->created_at->format('d M Y')); ?>

                                <p class="text-xs text-slate-400"><?php echo e($log->created_at->format('H:i:s')); ?></p>
                            </td>
                            <td class="px-4 py-3">
                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($log->causer): ?>
                                    <div class="flex items-center gap-2">
                                        <div class="w-7 h-7 rounded-full bg-orange-100 flex items-center justify-center shrink-0">
                                            <span class="text-orange-700 font-bold text-xs">
                                                <?php echo e(strtoupper(substr($log->causer->name, 0, 1))); ?>

                                            </span>
                                        </div>
                                        <span class="font-medium text-slate-800 whitespace-nowrap"><?php echo e($log->causer->name); ?></span>
                                    </div>
                                <?php else: ?>
                                    <span class="text-slate-400 text-xs">Sistem</span>
                                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                            </td>
                            <td class="px-4 py-3 text-slate-700">
                                <?php echo e($log->description); ?>

                            </td>
                            <td class="px-4 py-3 whitespace-nowrap">
                                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($log->log_name): ?>
                                    <span class="inline-flex px-2 py-0.5 rounded-full text-xs font-medium bg-slate-100 text-slate-600">
                                        <?php echo e(ucfirst($log->log_name)); ?>

                                    </span>
                                <?php else: ?>
                                    <span class="text-slate-400 text-xs">—</span>
                                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                            </td>
                            <td class="px-4 py-3 text-slate-500 font-mono text-xs whitespace-nowrap">
                                <?php echo e($log->ip_display); ?>

                            </td>
                            <td class="px-4 py-3 text-slate-500 whitespace-nowrap">
                                <?php echo e($log->browser_display); ?>

                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr>
                            <td colspan="6" class="px-4 py-16 text-center">
                                <svg class="w-12 h-12 mx-auto mb-3 text-slate-300" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"/>
                                </svg>
                                <p class="text-slate-400">Belum ada aktivitas tercatat.</p>
                            </td>
                        </tr>
                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                </tbody>
            </table>
        </div>

        
        <div class="flex flex-col sm:flex-row items-center justify-between gap-3 px-4 py-3 border-t border-slate-100">
            <div class="flex items-center gap-2 text-sm text-slate-500">
                <span>Tampilkan</span>
                <select wire:model.live="perPage"
                    class="px-2 py-1 border border-slate-300 rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-orange-500 bg-white">
                    <option value="10">10</option>
                    <option value="25">25</option>
                    <option value="50">50</option>
                    <option value="100">100</option>
                </select>
                <span>data per halaman</span>
            </div>
            <div><?php echo e($activities->links()); ?></div>
        </div>
    </div>

</div>
<?php /**PATH C:\laragon\www\titipin-babe\resources\views/livewire/admin/aktivitas/index.blade.php ENDPATH**/ ?>