<?php $__env->startSection('content'); ?>
    <div class="row">
        <div class="col-8">
            <div class="card">
                <div class="card-body">
                    <div class="d-md-flex align-items-center">
                        <div>
                            <h4 class="card-title">Kategori Produk</h4>
                        </div>
                    </div>
                    <div class="table-responsive mt-4">
                        <div class="row">
                            <div class="col-md-7">
                                <a href="<?php echo e(route('admin.product_category.create')); ?>">
                                    <button type="submit" style="height: 40px; !important;"
                                        class="btn btn-sm btn-primary rounded-2">Tambah</button>
                                </a>
                            </div>
                            <div class="col-md-5 d-flex justify-content-end">
                                <form action="<?php echo e(route('admin.product_category')); ?>" method="GET" style="display: flex">
                                    <input type="text" style="height: 40px" placeholder="Cari Nama" name="q_name"
                                        class="form-control" value="<?php echo e($q_name); ?>" id="name">
                                    <button type="submit" style="height: 40px; width: 50px !important; margin-left: 20px"
                                        class="btn btn-sm btn-secondary rounded-2">Cari</button>
                                </form>
                            </div>
                        </div>
                        <table class="table mb-0 text-nowrap varient-table align-middle fs-3">
                            <thead>
                                <tr>
                                    <th scope="col" class="px-0 text-muted">
                                        Nama
                                    </th>
                                    <th>Gambar</th>
                                    <th scope="col" class="px-0 text-muted">
                                        Aksi
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php if(!empty($q_name)): ?>
                                    <?php if(count($product_category) == 0): ?>
                                        <tr style="text-align: center">
                                            <td colspan="2">Data Belum Ada</td>
                                        </tr>
                                    <?php endif; ?>
                                <?php endif; ?>
                                <?php $__currentLoopData = $product_category; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td class="px-0"><?php echo e($item->name); ?></td>
                                        <td class="px-0"><img src="<?php echo e(asset('img_assets/category_product/' . $item->image)); ?>"
                                                style="width: 100px; height: 100px; object-fit: contain"></td>
                                        <td>
                                            <a href="<?php echo e(route('admin.product_category.edit', $item->id)); ?>"
                                                style="text-decoration: none">
                                                <button class="btn btn-warning btn-sm text-white mb-0 me-0"
                                                    type="button"><i class="mdi mdi-pencil"></i>Edit</button>
                                            </a>
                                            <form action="<?php echo e(route('admin.product_category.delete')); ?>"
                                                style="display: inline-block" method="POST">
                                                <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
                                                <input type="hidden" value="<?php echo e($item->id); ?>" name="id">
                                                <button class="btn btn-danger btn-sm text-white mb-0 me-0" type="submit"><i
                                                        class="mdi mdi-delete"></i>Hapus</button>
                                            </form>
                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.admin', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp8\htdocs\pasar_nelayan_zaskia\resources\views/apps/admin/product_category/index.blade.php ENDPATH**/ ?>