<?php $__env->startSection('titulo', $meta['titulo']); ?>
<?php $__env->startSection('contenido'); ?>
<div class="d-flex flex-wrap justify-content-between align-items-center mb-3">
  <h4 class="mb-0"><i class="fa fa-book"></i> <?php echo e($meta['titulo']); ?></h4>
  <a href="<?php echo e(route('catalogos.create', $slug)); ?>" class="btn btn-primario"><i class="fa fa-plus"></i> Nuevo</a>
</div>
<form method="GET" class="mb-3">
  <div class="input-group">
    <input name="q" value="<?php echo e($busqueda); ?>" class="form-control" placeholder="Buscar por código o nombre">
    <button class="btn btn-outline-primary"><i class="fa fa-search"></i></button>
  </div>
</form>
<div class="card">
  <div class="table-responsive">
    <table class="table table-striped table-hover mb-0 table-sticky">
      <thead><tr>
        <?php $__currentLoopData = $meta['campos']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $c): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><th><?php echo e($c[1]); ?></th><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        <th class="text-end">Acciones</th>
      </tr></thead>
      <tbody>
      <?php $__empty_1 = true; $__currentLoopData = $registros; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $r): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
        <tr>
          <?php $__currentLoopData = $meta['campos']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $c): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <?php $val = $r->{$c[0]} ?? null; ?>
            <td>
              <?php if($c[2]==='bool'): ?>
                <span class="badge text-bg-<?php echo e($val ? 'success' : 'secondary'); ?>"><?php echo e($val ? 'Sí' : 'No'); ?></span>
              <?php elseif($c[2]==='color' && $val): ?>
                <span class="badge" style="background: <?php echo e($val); ?>; color:#fff;"><?php echo e($val); ?></span>
              <?php else: ?>
                <?php echo e($val); ?>

              <?php endif; ?>
            </td>
          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
          <td class="text-end">
            <a href="<?php echo e(route('catalogos.edit', [$slug, $r->id])); ?>" class="btn btn-sm btn-outline-primary"><i class="fa fa-pen"></i></a>
            <form action="<?php echo e(route('catalogos.destroy', [$slug, $r->id])); ?>" method="POST" class="d-inline" onsubmit="return confirm('¿Eliminar?');">
              <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
              <button class="btn btn-sm btn-outline-danger"><i class="fa fa-trash"></i></button>
            </form>
          </td>
        </tr>
      <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
        <tr><td colspan="<?php echo e(count($meta['campos'])+1); ?>" class="text-center text-muted py-4">Sin registros</td></tr>
      <?php endif; ?>
      </tbody>
    </table>
  </div>
</div>
<div class="mt-2"><?php echo e($registros->links()); ?></div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\mto\resources\views/catalogos/simple_index.blade.php ENDPATH**/ ?>