

<?php $__env->startSection('title', 'Product Management'); ?>

<?php $__env->startSection('content'); ?>
<div class="space-y-6">
    <div class="rounded-3xl bg-white p-8 shadow-sm flex flex-col gap-4 md:flex-row md:items-center md:justify-between">
        <div>
            <h1 class="text-3xl font-semibold">Product Management</h1>
            <p class="mt-2 text-slate-600">Add, edit, or remove products from the store.</p>
        </div>
        <a href="<?php echo e(route('admin.products.create')); ?>" class="rounded-full bg-slate-900 px-6 py-3 text-white hover:bg-slate-800">Upload Product</a>
    </div>

    <div class="overflow-x-auto rounded-3xl bg-white shadow-sm">
        <table class="min-w-full divide-y divide-slate-200 text-sm">
            <thead class="bg-slate-50 text-slate-700">
                <tr>
                    <th class="px-6 py-4 text-left font-semibold">Name</th>
                    <th class="px-6 py-4 text-left font-semibold">Category</th>
                    <th class="px-6 py-4 text-left font-semibold">Price</th>
                    <th class="px-6 py-4 text-left font-semibold">Discount</th>
                    <th class="px-6 py-4 text-left font-semibold">Tags</th>
                    <th class="px-6 py-4 text-left font-semibold">Actions</th>
                </tr>
            </thead>
            <tbody class="divide-y divide-slate-200 bg-white">
                <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td class="px-6 py-4"><?php echo e($product->name); ?></td>
                        <td class="px-6 py-4"><?php echo e($product->category->name); ?></td>
                        <td class="px-6 py-4">₹<?php echo e(number_format($product->display_price, 2)); ?></td>
                        <td class="px-6 py-4"><?php echo e($product->discount_percent); ?>%</td>
                        <td class="px-6 py-4">
                            <?php if($product->is_special_pick): ?><span class="rounded-full bg-emerald-50 px-2 py-1 text-xs text-emerald-700">Special</span><?php endif; ?>
                            <?php if($product->is_flash_deal): ?><span class="rounded-full bg-rose-50 px-2 py-1 text-xs text-rose-700">Flash</span><?php endif; ?>
                            <?php if($product->is_best_seller): ?><span class="rounded-full bg-sky-50 px-2 py-1 text-xs text-sky-700">Bestseller</span><?php endif; ?>
                        </td>
                        <td class="px-6 py-4 space-x-2">
                            <a href="<?php echo e(route('admin.products.edit', $product->id)); ?>" class="text-slate-700 hover:text-slate-900">Edit</a>
                            <form action="<?php echo e(route('admin.products.destroy', $product->id)); ?>" method="POST" class="inline">
                                <?php echo csrf_field(); ?>
                                <?php echo method_field('DELETE'); ?>
                                <button type="submit" class="text-rose-600 hover:text-rose-800">Delete</button>
                            </form>
                        </td>
                    </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </tbody>
        </table>
    </div>

    <div><?php echo e($products->links()); ?></div>
</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\phunt\resources\views/admin/products/index.blade.php ENDPATH**/ ?>