<?php $__env->startSection('title', 'Categorias | Veltrix v2'); ?>
<?php $__env->startSection('page_title', 'Categorias'); ?>
<?php $__env->startSection('page_subtitle', 'Gestion operativa en tiempo real'); ?>
<?php $__env->startSection('page_icon', 'bx bxs-category'); ?>

<?php $__env->startSection('content'); ?>
    <div class="container-fluid px-4 py-4">
        <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($errors->any()): ?>
            <div class="alert alert-danger mb-3">
                <?php echo e($errors->first()); ?>

            </div>
        <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

        <div class="row g-3">
            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(has_permission('categorias.crear')): ?>
                <div class="col-lg-5">
                    <div class="card border-0 shadow-sm h-100">
                        <div class="card-body">
                            <h2 class="h5 mb-3">Nueva categoria</h2>
                            <form action="<?php echo e(route('categorias.store')); ?>" method="POST">
                                <?php echo csrf_field(); ?>
                                <input type="hidden" name="activo" value="1">

                                <div class="mb-3">
                                    <label class="form-label fw-semibold" for="categoriaNombre">Nombre</label>
                                    <input
                                        class="form-control"
                                        id="categoriaNombre"
                                        name="nombre"
                                        maxlength="120"
                                        value="<?php echo e(old('nombre', '')); ?>"
                                        required
                                    >
                                </div>

                                <div class="mb-3">
                                    <label class="form-label fw-semibold" for="categoriaDescripcion">Descripcion</label>
                                    <textarea
                                        class="form-control"
                                        id="categoriaDescripcion"
                                        name="descripcion"
                                        rows="4"
                                        maxlength="255"
                                    ><?php echo e(old('descripcion', '')); ?></textarea>
                                </div>

                                <button class="btn btn-primary w-100" type="submit">Guardar</button>
                            </form>
                        </div>
                    </div>
                </div>

                <div class="col-lg-7">
            <?php else: ?>
                <div class="col-12">
            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                <div class="card border-0 shadow-sm h-100">
                    <div class="card-body">
                        <h2 class="h3 mb-3">Categorias</h2>
                        <div class="table-responsive">
                            <table class="table table-striped align-middle mb-0">
                                <thead>
                                    <tr>
                                        <th>ID</th>
                                        <th>NOMBRE</th>
                                        <th>DESCRIPCION</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__empty_1 = true; $__currentLoopData = $categorias; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $categoria): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoopIteration(); ?><?php endif; ?>
                                        <tr>
                                            <td><?php echo e($categoria->id); ?></td>
                                            <td><?php echo e($categoria->nombre); ?></td>
                                            <td><?php echo e((string) ($categoria->descripcion ?? '')); ?></td>
                                        </tr>
                                    <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>
                                        <tr>
                                            <td colspan="3" class="text-center py-4 text-muted">No hay categorias registradas.</td>
                                        </tr>
                                    <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /Applications/XAMPP/xamppfiles/htdocs/veltrix-v2/resources/views/modules/categorias/index.blade.php ENDPATH**/ ?>