<div class="ml-[280px] min-h-screen space-y-6">

    <div class="flex justify-between items-center">
        <h1 class="text-2xl font-bold">Menus</h1>

        <div class="flex gap-3">
            <input type="text" wire:model.debounce.500ms="search" placeholder="Search menu..."
                class="border rounded-lg px-4 py-2 text-sm">

            <a href="/console/menus/add" class="bg-[#f38121] text-white px-4 py-2 rounded">
                + Add Menu
            </a>
        </div>
    </div>
    <!-- ✅ SUCCESS MESSAGE -->
    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(session()->has('success')): ?>
        <div class="bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded-lg text-sm">
            <?php echo e(session('success')); ?>

        </div>
    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
    <!-- MENU LIST -->
    <div class="bg-white border rounded-2xl shadow-sm overflow-hidden">

        <table class="w-full text-sm border-separate border-spacing-y-2">
            <thead class="bg-gray-50 border-b">
                <tr class="text-left text-gray-600">
                    <th class="px-5 py-4">ID</th>
                    <th class="px-4">Category</th>
                    <th class="px-4">Title</th>
                    <th class="px-4">URL</th>
                    <th class="px-4">Slug</th>
                    <th class="px-4">Position</th>
                    <th class="px-4">Status</th>
                    <th class="text-right px-5">Action</th>
                </tr>
            </thead>

            <tbody>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__empty_1 = true; $__currentLoopData = $menus; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $menu): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr class="bg-white hover:bg-gray-50 transition
                           shadow-sm rounded-xl">

                        <td class="px-5 py-4 text-gray-600">
                            <?php echo e($menu->id); ?>

                        </td>

                        <td class="px-4 py-4">
                            <?php echo e($categories[$menu->menu_category_id]->name ?? '—'); ?>

                        </td>

                        <td class="px-4 py-4 font-semibold text-gray-800">
                            <?php echo e($menu->title); ?>

                        </td>

                        <td class="px-4 py-4 text-gray-500">
                            <?php echo e($menu->url); ?>

                        </td>

                        <td class="px-4 py-4 text-gray-500">
                            <?php echo e($menu->slug); ?>

                        </td>

                        <td class="px-4 py-4 text-gray-500">
                            <?php echo e($menu->position); ?>

                        </td>

                        <td class="px-4 py-4">
                            <span
                                class="inline-flex items-center px-3 py-1 text-xs font-medium rounded-full
                            <?php echo e($menu->status ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-700'); ?>">
                                <?php echo e($menu->status ? 'Active' : 'Inactive'); ?>

                            </span>
                        </td>

                        <td class="text-right px-5 py-4 space-x-4">
                            <a href="<?php echo e(route('admin.menus.edit', $menu->id)); ?>"
                                class="text-blue-600 hover:text-blue-800 font-medium">
                                Edit
                            </a>

                            <button onclick="confirm('Are you sure?') || event.stopImmediatePropagation()"
                                wire:click="delete(<?php echo e($menu->id); ?>)"
                                class="text-red-600 hover:text-red-800 font-medium">
                                Delete
                            </button>
                        </td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr>
                        <td colspan="8" class="py-10 text-center text-gray-400">
                            No menus found
                        </td>
                    </tr>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            </tbody>
        </table>

        <div class="p-6 border-t">
            <?php echo e($menus->links()); ?>

        </div>
    </div>


</div>
<?php /**PATH /home/eggfirst/public_html/video.eggfirst.com/resources/views/livewire/admin/menus/list.blade.php ENDPATH**/ ?>