<?php $__env->startSection('title', 'Kelola Opsi Jawaban - SKM Survey'); ?>

<?php $__env->startSection('content'); ?>
<div class="container-fluid">
    <div class="row mb-4">
        <div class="col-12">
            <h2 style="color: #1e3a8a; font-weight: 700;">
                <i class="bi bi-list-check me-2"></i> Kelola Opsi Jawaban
            </h2>
            <p class="text-muted">Konfigurasi opsi jawaban untuk Survey Kepuasan Masyarakat</p>
        </div>
    </div>

    <div class="card card-gov shadow-sm mb-4">
        <div class="card-header d-flex justify-content-between align-items-center">
            <h5 class="mb-0">
                <i class="bi bi-list-ul me-2"></i> Daftar Opsi Jawaban
            </h5>
            <a href="<?php echo e(route('admin.answer-options.create')); ?>" class="btn btn-gov-primary">
                <i class="bi bi-plus-circle me-2"></i> Tambah Opsi Jawaban
            </a>
        </div>
        <div class="card-body">
            <div class="table-responsive">
                <table class="table table-hover align-middle">
                    <thead class="table-light">
                        <tr>
                            <th style="width: 50px;">No</th>
                            <th>Text Jawaban</th>
                            <th style="width: 100px;" class="text-center">Score</th>
                            <th style="width: 100px;" class="text-center">Weight</th>
                            <th style="width: 100px;" class="text-center">Order</th>
                            <th style="width: 100px;" class="text-center">Status</th>
                            <th style="width: 200px;" class="text-center">Aksi</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $__empty_1 = true; $__currentLoopData = $answerOptions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $option): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <tr>
                                <td class="fw-semibold"><?php echo e($index + 1); ?></td>
                                <td>
                                    <strong><?php echo e($option->text); ?></strong>
                                </td>
                                <td class="text-center">
                                    <span class="badge bg-info"><?php echo e($option->score); ?></span>
                                </td>
                                <td class="text-center">
                                    <span class="badge bg-secondary"><?php echo e(number_format($option->weight, 2)); ?></span>
                                </td>
                                <td class="text-center">
                                    <span class="badge bg-primary"><?php echo e($option->order); ?></span>
                                </td>
                                <td class="text-center">
                                    <?php if($option->is_active): ?>
                                        <span class="badge bg-success">Aktif</span>
                                    <?php else: ?>
                                        <span class="badge bg-secondary">Tidak Aktif</span>
                                    <?php endif; ?>
                                </td>
                                <td>
                                    <div class="btn-group" role="group">
                                        <a href="<?php echo e(route('admin.answer-options.edit', $option->id)); ?>" class="btn btn-sm btn-primary">
                                            <i class="bi bi-pencil"></i> Edit
                                        </a>
                                        <form action="<?php echo e(route('admin.answer-options.destroy', $option->id)); ?>" method="POST" class="d-inline" onsubmit="return confirm('Apakah Anda yakin ingin menghapus opsi jawaban ini?');">
                                            <?php echo csrf_field(); ?>
                                            <?php echo method_field('DELETE'); ?>
                                            <button type="submit" class="btn btn-sm btn-danger">
                                                <i class="bi bi-trash"></i> Hapus
                                            </button>
                                        </form>
                                    </div>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <tr>
                                <td colspan="7" class="text-center py-4">
                                    <i class="bi bi-inbox text-muted" style="font-size: 3rem;"></i>
                                    <p class="text-muted mt-2 mb-0">Belum ada opsi jawaban</p>
                                    <a href="<?php echo e(route('admin.answer-options.create')); ?>" class="btn btn-gov-primary mt-3">
                                        <i class="bi bi-plus-circle me-2"></i> Tambah Opsi Jawaban Pertama
                                    </a>
                                </td>
                            </tr>
                        <?php endif; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Users/user/Documents/giriwidyan/project/inhouse/skm/resources/views/admin/answer-options/index.blade.php ENDPATH**/ ?>