<div class="d-flex flex-column flex-md-row justify-content-between align-items-md-center gap-2 mb-3">
    <h1 class="h3 mb-0">Listado de <?php echo e($entityPluralLabel); ?></h1>
    <div class="d-flex gap-2">
        <a href="<?php echo e(route('administracion.index')); ?>" class="btn btn-outline-secondary">Volver a Adm.</a>
        <?php if($entity === 'tipos-insumos'): ?>
            <a class="btn btn-outline-primary" href="<?php echo e(route('administracion.crud.index', ['entity' => 'bienes'])); ?>">Volver a Bienes</a>
        <?php endif; ?>
        <?php if($entity === 'bienes'): ?>
            <a class="btn btn-outline-secondary" href="<?php echo e(route('administracion.crud.index', ['entity' => 'tipos-insumos'])); ?>">Tipos de Bien</a>
        <?php endif; ?>
        <?php if(! ($isReadOnly ?? false)): ?>
            <a class="btn btn-outline-primary" href="<?php echo e(route('administracion.crud.import.form', ['entity' => $entity])); ?>">Importar por Lote</a>
            <button class="btn btn-brand" type="button" id="openCreateModalBtn">Nuevo registro</button>
        <?php endif; ?>
    </div>
</div>

<?php if($entity === 'bienes'): ?>
    <?php echo $__env->make('partials.scanner-hint', [
        'text' => 'Escanee el codigo del bien para buscarlo en el listado.',
        'className' => 'text-muted-brand small mb-3',
    ], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
<?php endif; ?>

<form id="crudSearchForm" class="crud-card mb-3" method="GET" action="<?php echo e(route('administracion.crud.index', ['entity' => $entity])); ?>" autocomplete="off">
    <div class="card-body p-3 d-flex flex-column flex-md-row gap-2 align-items-md-center">
        <div class="input-group">
            <?php if($entity === 'bienes'): ?>
                <button class="btn btn-outline-secondary" type="button" title="Escanear código" id="scanBienBtn">
                    <img class="scanner-button-icon" src="<?php echo e(asset('imgs/scan_barcode.svg')); ?>" alt="" aria-hidden="true">
                </button>
            <?php endif; ?>
            <input
                id="crudSearchInput"
                type="text"
                class="form-control"
                name="q"
                value="<?php echo e($search ?? ''); ?>"
                autocomplete="off"
                placeholder="<?php echo e($searchPlaceholder ?? ('Buscar en ' . $entityPluralLabel)); ?>"
            >
        </div>
        <div class="d-flex flex-column flex-sm-row gap-2 ms-md-auto">
            <select class="form-select" name="per_page" onchange="this.form.submit()" aria-label="Resultados por pagina" style="min-width: 11rem;">
                <?php $__currentLoopData = [10, 50, 100]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $pageSize): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="<?php echo e($pageSize); ?>" <?php if(($perPage ?? 10) === $pageSize): echo 'selected'; endif; ?>>
                        <?php echo e($pageSize); ?> por pagina
                    </option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
            <button class="btn btn-brand" type="submit">Buscar</button>
            <a class="btn btn-outline-secondary" href="<?php echo e(route('administracion.crud.index', ['entity' => $entity, 'per_page' => $perPage ?? 10])); ?>">Limpiar</a>
        </div>
    </div>
</form>

<?php if(filled($search ?? '')): ?>
    <p class="text-muted small mb-3">Buscando por: '<?php echo e($search); ?>'</p>
<?php endif; ?>
<?php /**PATH C:\xampp\htdocs\almacen2\resources\views/administracion/crud/partials/header.blade.php ENDPATH**/ ?>