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

<?php $__env->startSection('content'); ?>
<div class="walton-card walton-animated">
    <div class="walton-card-header">
        <i class="fas fa-weight"></i> Unit Management
        <div class="float-end">
            <a href="<?php echo e(route('settings.units.create')); ?>" class="walton-btn walton-btn-gold btn-sm">
                <i class="fas fa-plus-circle me-2"></i>Add New Unit
            </a>
        </div>
    </div>
    <div class="walton-card-body">
        <table class="walton-table">
            <thead>
                <tr>
                    <th>SL</th>
                    <th>Name</th>
                    <th>Code</th>
                    <th>Symbol</th>
                    <th>Description</th>
                    <th>Status</th>
                    <th>Actions</th>
                </tr>
            </thead>
            <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $units; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $unit): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr>
                    <td><?php echo e($key + 1); ?></td>
                    <td><strong><?php echo e($unit->name); ?></strong></td>
                    <td><code><?php echo e($unit->code); ?></code></td>
                    <td><span class="badge bg-info"><?php echo e($unit->symbol); ?></span></td>
                    <td><?php echo e(Str::limit($unit->description, 50)); ?></td>
                    <td><?php echo $unit->status_badge; ?></td>
                    <td>
                        <a href="<?php echo e(route('settings.units.edit', $unit)); ?>" class="walton-btn walton-btn-primary btn-sm">
                            <i class="fas fa-edit"></i>
                        </a>
                        <form action="<?php echo e(route('settings.units.destroy', $unit)); ?>" method="POST" class="d-inline">
                            <?php echo csrf_field(); ?>
                            <?php echo method_field('DELETE'); ?>
                            <button type="submit" class="walton-btn walton-btn-danger btn-sm" 
                                    onclick="return confirm('Are you sure?')">
                                <i class="fas fa-trash"></i>
                            </button>
                        </form>
                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr>
                    <td colspan="7" class="text-center">No units found.</td>
                </tr>
                <?php endif; ?>
            </tbody>
        </table>
        
        <div class="mt-3">
            <?php echo e($units->links()); ?>

        </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 /home/naowarin/walton.naowarinternational.my.id/resources/views/settings/units/index.blade.php ENDPATH**/ ?>