<div class="ml-[280px] min-h-screen bg-gray-50 p-8">

    <!-- HEADER -->
    <div class="flex flex-wrap gap-4 justify-between items-center mb-6">
        <div>
            <h1 class="text-2xl font-semibold text-gray-900">Contact Leads</h1>
            <p class="text-sm text-gray-500">All enquiries from website</p>
        </div>

        <div class="flex gap-3 flex-wrap">
            <!-- Search -->
            <input type="text" wire:model.debounce.400ms="search" placeholder="Search name, email or phone..."
                class="border rounded-lg px-4 py-2 text-sm">


            <!-- Filter -->
            <select wire:model="service" class="border rounded-lg px-4 py-2 text-sm">
                <option value="">All Services</option>
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__currentLoopData = $services; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $srv): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="<?php echo e($srv); ?>"><?php echo e($srv); ?></option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            </select>


            <!-- Export -->
            <button wire:click="exportCsv"
                class="bg-[#f38121] text-white px-4 py-2 rounded-lg text-sm hover:bg-[#e06f18] transition">
                Export CSV
            </button>
        </div>
    </div>

    <!-- TABLE -->
    <div class="bg-white rounded-xl shadow border overflow-hidden">
        <table class="w-full text-sm">
            <thead class="bg-gray-100 text-gray-600">
                <tr>
                    <th class="px-4 py-3 text-left">#</th>
                    <th class="px-4 py-3 text-left">Name</th>
                    <th class="px-4 py-3 text-left">Phone</th>
                    <th class="px-4 py-3 text-left">Email</th>
                    <th class="px-4 py-3 text-left">Service</th>
                    <th class="px-4 py-3 text-left">Message</th>
                    <th class="px-4 py-3 text-left">Date</th>
                </tr>
            </thead>
            <tbody class="divide-y">
                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__empty_1 = true; $__currentLoopData = $leads; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $lead): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <tr class="hover:bg-gray-50">
                        <td class="px-4 py-3">
                            <?php echo e(($leads->currentPage() - 1) * $leads->perPage() + $loop->iteration); ?>

                        </td>
                        <td class="px-4 py-3 font-medium"><?php echo e($lead->name); ?></td>
                        <td class="px-4 py-3"><?php echo e($lead->phone); ?></td>
                        <td class="px-4 py-3"><?php echo e($lead->email); ?></td>
                        <td class="px-4 py-3"><?php echo e($lead->service); ?></td>
                      <td class="px-4 py-3 max-w-[220px]">
                        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(!empty($lead->message)): ?>
                            <span class="block text-gray-700 text-sm leading-snug truncate">
                                <?php echo e($lead->message); ?>

                            </span>
                        <?php else: ?>
                            <span
                                class="inline-flex items-center gap-1.5 px-3 py-1.5
                                       rounded-full text-xs font-medium
                                       bg-slate-100 text-slate-500
                                       border border-slate-200">
                                <svg xmlns="http://www.w3.org/2000/svg" class="w-3.5 h-3.5 opacity-70" fill="none" viewBox="0 0 24 24"
                                     stroke="currentColor">
                                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
                                          d="M8 10h.01M12 10h.01M16 10h.01M9 16h6M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
                                </svg>
                                No Message
                            </span>
                        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                    </td>


                        <td class="px-4 py-3 text-gray-500">
                            <?php echo e($lead->created_at->format('d M Y')); ?>

                        </td>
                    </tr>

                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <tr>
                        <td colspan="7" class="text-center py-6 text-gray-400">
                            No leads found
                        </td>
                    </tr>
                <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
            </tbody>
        </table>
    </div>

    <!-- PAGINATION -->
    <div class="mt-6">
        <?php echo e($leads->links()); ?>

    </div>

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