<?php $__env->startSection('content'); ?>
<div class="container-xxl flex-grow-1 container-p-y">
  <div class="card">
    <div class="card-header d-flex justify-content-between align-items-center">
      <h5 class="mb-0">Services</h5>
      <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('create services')): ?>
        <a href="<?php echo e(route('admin.services.create')); ?>" class="btn btn-sm btn-primary">Add Service</a>
      <?php endif; ?>
    </div>

    <div class="table-responsive">
      <table <?php if($services->count() > 0): ?> id="services-table" <?php endif; ?> class="table">
        <thead>
          <tr>
            <th>Name</th>
            <th>Category</th>
            <th>Slug</th>
            <th>Status</th>
            <th>Action</th>
          </tr>
        </thead>
        <tbody>
          <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php $__empty_1 = true; $__currentLoopData = $services; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $service): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <tr>
              <td><?php echo e($service->name); ?></td>
              <td><?php echo e($service->category->name ?? 'N/A'); ?></td>
              <td><?php echo e($service->slug); ?></td>
              <td><?php echo e($service->is_active ? 'Active' : 'Pending'); ?></td>
              <td>
                <div class="d-flex gap-2">
                  <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('update services')): ?>
                    <a href="<?php echo e(route('admin.services.edit', $service)); ?>" class="btn btn-sm btn-outline-primary">Edit</a>
                  <?php endif; ?>

                  <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('delete services')): ?>
                    <form method="POST" action="<?php echo e(route('admin.services.destroy', $service)); ?>">
                      <?php echo csrf_field(); ?>
                      <?php echo method_field('DELETE'); ?>
                      <button type="submit" class="btn btn-sm btn-outline-danger" onclick="return confirm('Delete this service?')">Delete</button>
                    </form>
                  <?php endif; ?>
                </div>
              </td>
            </tr>
          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <tr><td colspan="5" class="text-center py-4">No services found.</td></tr>
          <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
        </tbody>
      </table>
    </div>

    <div class="card-body"><?php echo e($services->links()); ?></div>
  </div>
</div>
<?php $__env->stopSection(); ?>

<?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($services->count() > 0): ?>
<?php $__env->startPush('script'); ?>
<script>
$(document).ready(function () {
  const $table = $('#services-table');
  if (!$table.length) return;

  $table.DataTable({
    responsive: false,
    scrollX: true,
    pageLength: 10,
    lengthMenu: [5, 10, 25, 50, 100],
    order: [[0, 'asc']],
    columnDefs: [{ orderable: false, targets: -1 }]
  });
});
</script>
<?php $__env->stopPush(); ?>
<?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH F:\xampp\htdocs\G_desizn\marketplace\resources\views/admin/services/index.blade.php ENDPATH**/ ?>