<div>

    <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
        <div class="muduleTitle">
            <h1><?php echo e(__('Insumos')); ?></h1>
        </div>
        <div class="inputTitle">
            <input type="text" class="inputSearch" wire:model="search">
            <button class="btn " wire:click="$toggle('imputActive')"><i class="fa fa-plus"></i>Añadir Insumo</button>
            <!-- <button class="btn " wire:click="$emit('openModal', 'create-supply')"><i class="fa fa-plus"></i>Añadir Insumo</button> -->
        </div>
    </div>
    <div class="py-12">
        <div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
        <?php if($imputActive or $updateMode): ?>
            <div class="flex w-full justify-between">
                <div class="dataBox dataBox--top">
                    <div class="rowBox">
                        <div class="labelBox">
                            Nombre
                        </div>
                        <div class="inputBox">
                            <input type="text" placeholder="Nombre" class="form-control" wire:model.defer="name"
                            style="margin-right:5px;">
                            <input type="hidden" wire:model.defer="supply_id">
                        </div>
                    </div>
                    <div class="rowBox">
                        <div class="labelBox">
                            Codigo
                        </div>
                        <div class="inputBox">
                            <input type="text" placeholder="Codigo" class="form-control" wire:model.defer="code"
                            style="margin-right:5px;">
                        </div>
                    </div>
                    <div class="rowBox">
                        <div class="labelBox">
                            Familia
                        </div>
                        <div class="inputBox">

                            <select wire:model.defer="family_id" name="family">
                                <?php $__currentLoopData = $families; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $family): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($family->id == $family_id): ?>
                                        <option value="<?php echo e($family->id); ?>" selected><?php echo e($family->name); ?></option>
                                    <?php else: ?>
                                        <option value="<?php echo e($family->id); ?>"><?php echo e($family->name); ?></option>
                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        </div>
                    </div>
                    <div class="rowBox">
                        <div class="labelBox">
                            Detalle
                        </div>
                        <div class="inputBox">
                            <input type="text" placeholder="Detalle" class="form-control" wire:model.defer="description"
                            style="margin-right:5px;">
                        </div>
                    </div>
                    <div class="rowBox">
                        <div class="labelBox">
                            Ubicación
                        </div>
                        <div class="inputBox">
                            <input type="text" placeholder="Ubicación" class="form-control" wire:model.defer="location"
                            style="margin-right:5px;">
                        </div>
                    </div>
                    <div class="rowBox">
                        <div class="labelBox">
                            Agregar Imagen
                        </div>
                        <div class="inputBox">
                            <input type="text" placeholder="Imagen" class="form-control" wire:model.defer="image"
                            style="margin-right:5px;">
                        </div>
                    </div>
                    <div class="rowBox">
                        <div class="labelBox">
                            Agregar Archivo
                        </div>
                        <div class="inputBox">
                            <input type="text" placeholder="Archivo" class="form-control" wire:model.defer="file"
                            style="margin-right:5px;">
                        </div>
                    </div>
                </div>
                <div class="dataBox dataBox--top dataBox--marginLeft">
                    <div class="rowBox rowBox--lit rowBox--fat">
                        <div class="labelBox labelBox--unwidth">
                            Especificaciones Actuales
                        </div>
                    </div>
                    <?php $__empty_1 = true; $__currentLoopData = $familyunits; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $units): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <div class="rowBox rowBox--lit">
                        <div class="labelBox">
                            <?php echo e($units->description); ?>

                        </div>
                        <div>
                            <?php echo e($units->pivot->valor ?? ''); ?>

                        </div>
                    </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <div class="rowBox rowBox--lit">
                        <div class="labelBox">
                            Debe ir a la pantalla familias y definir que especificaciones o unidades tendra esta familia
                        </div>
                    </div>
                    <?php endif; ?>
                    <div class="rowBox rowBox--lit rowBox--fat">
                        <div class="labelBox labelBox--unwidth">
                            Actualizar Especificaciones
                        </div>
                    </div>
                    <?php $__empty_1 = true; $__currentLoopData = $familyunits; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $units): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                    <div class="rowBox rowBox--lit">
                        <div class="labelBox">
                            <?php echo e($units->description); ?>

                        </div>
                        <div>
                            <input type="text"
                                name="listunit.<?php echo e($units->id); ?>"
                                wire:model.defer='listunit.<?php echo e($units->id); ?>'>
                        </div>
                    </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <div class="rowBox rowBox--lit">
                        <div class="labelBox">
                            Debe ir a la pantalla familias y definir que especificaciones o unidades tendra esta familia
                        </div>
                    </div>
                    <?php endif; ?>
                    <div class="rowBox rowBox--lit rowBox--fat">
                        <div class="labelBox labelBox--unwidth">
                            <button wire:click="generatecode">Generar Codigo</button>
                        </div>
                    </div>
                    <div class="rowBox">
                        <div class="labelBox--full">
                            <button class="btn" wire:click="save">
                                <i class="fa fa-save"></i>Guardar
                            </button>
                            <button class="btn" wire:click="resetInput">
                                <i class="fa fa-trash"></i>Cancelar
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        <?php else: ?>
            <div class="flex w-full">
                <table class="quamaqTable">
                    <thead>
                        <th>Imagen</th>
                        <th>Nombre</th>
                        <th>Codigo</th>
                        <th>Familia</th>
                        <th>Detalle</th>
                        <th>Ubicacion</th>
                        <th>Ficha</th>
                        <th></th>
                    </thead>
                    <tbody>
                        <?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $supplier): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <td><img src="<?php echo e(asset('/storage/images/machine.jpg')); ?>"></td>
                            <td><?php echo e($supplier->name); ?></td>
                            <td><?php echo e($supplier->code); ?></td>
                            <td><?php echo e($supplier->family->name); ?></td>
                            <td><?php echo e($supplier->description); ?></td>
                            <td><?php echo e($supplier->location); ?></td>
                            <td><img src="<?php echo e(asset('/storage/images/clip.jpg')); ?>"></td>
                            <td>
                                <img src="<?php echo e(asset('/storage/images/edit.jpg')); ?>" wire:click="edit(<?php echo e($supplier->id); ?>)">
                                <img src="<?php echo e(asset('/storage/images/trash.jpg')); ?>" wire:click="destroy(<?php echo e($supplier->id); ?>)">
                            </td>
                        </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                </table>
            </div>

            <!-- <div class="bg-white dark:bg-gray-800 overflow-hidden shadow-xl sm:rounded-lg">
                <?php if (isset($component)) { $__componentOriginal71c6471fa76ce19017edc287b6f4508c = $component; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.welcome','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('welcome'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(Illuminate\View\AnonymousComponent::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal71c6471fa76ce19017edc287b6f4508c)): ?>
<?php $component = $__componentOriginal71c6471fa76ce19017edc287b6f4508c; ?>
<?php unset($__componentOriginal71c6471fa76ce19017edc287b6f4508c); ?>
<?php endif; ?>
            </div> -->
        <?php endif; ?>
        </div>

    </div>
</div>
<?php /**PATH C:\laragon\www\quamaq\resources\views/livewire/supplies.blade.php ENDPATH**/ ?>