<?php $__env->startSection('title', 'View Category'); ?>
<?php $__env->startSection('page-title', 'View Category'); ?>

<?php $__env->startSection('content'); ?>
<div class="bg-white rounded-lg shadow p-6 mb-6">
    <div class="flex items-center justify-between mb-6">
        <h3 class="text-2xl font-bold text-gray-800"><?php echo e($category->name); ?></h3>
        <div class="flex space-x-2">
            <a href="<?php echo e(route('admin.categories.edit', $category)); ?>" class="bg-blue-600 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded">
                <i class="fas fa-edit mr-2"></i>Edit
            </a>
            <a href="<?php echo e(route('admin.categories.index')); ?>" class="bg-gray-500 hover:bg-gray-700 text-white font-bold py-2 px-4 rounded">
                Back
            </a>
        </div>
    </div>

    <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
        <div>
            <h4 class="text-lg font-semibold mb-4">Category Information</h4>
            <dl class="space-y-2">
                <div>
                    <dt class="text-sm font-medium text-gray-500">Name (Khmer)</dt>
                    <dd class="text-sm text-gray-900"><?php echo e($category->name_km ?? 'N/A'); ?></dd>
                </div>
                <div>
                    <dt class="text-sm font-medium text-gray-500">Code</dt>
                    <dd class="text-sm text-gray-900"><?php echo e($category->code); ?></dd>
                </div>
                <?php if($category->parent): ?>
                    <div>
                        <dt class="text-sm font-medium text-gray-500">Parent Category</dt>
                        <dd class="text-sm text-gray-900"><?php echo e($category->parent->name); ?></dd>
                    </div>
                <?php endif; ?>
                <div>
                    <dt class="text-sm font-medium text-gray-500">Subcategories</dt>
                    <dd class="text-sm text-gray-900"><?php echo e($category->subcategories->count()); ?></dd>
                </div>
                <div>
                    <dt class="text-sm font-medium text-gray-500">Products</dt>
                    <dd class="text-sm text-gray-900"><?php echo e($category->products->count()); ?></dd>
                </div>
            </dl>
        </div>

        <div>
            <h4 class="text-lg font-semibold mb-4">Description</h4>
            <p class="text-sm text-gray-700 mb-4"><?php echo e($category->description ?? 'No description'); ?></p>
            <h4 class="text-lg font-semibold mb-4">Description (Khmer)</h4>
            <p class="text-sm text-gray-700"><?php echo e($category->description_km ?? 'No description'); ?></p>
        </div>
    </div>

    <?php if($category->isMainCategory() && $category->subcategories->count() > 0): ?>
        <div class="mt-6">
            <h4 class="text-lg font-semibold mb-4">Subcategories</h4>
            <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
                <?php $__currentLoopData = $category->subcategories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $subcategory): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="border rounded p-4">
                        <h5 class="font-semibold"><?php echo e($subcategory->name); ?></h5>
                        <p class="text-sm text-gray-600"><?php echo e($subcategory->code); ?></p>
                        <a href="<?php echo e(route('admin.categories.show', $subcategory)); ?>" class="text-blue-600 text-sm mt-2 inline-block">View</a>
                    </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        </div>
    <?php endif; ?>
</div>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /Users/mac/Documents/e-com/resources/views/admin/categories/show.blade.php ENDPATH**/ ?>