<?php $__env->startSection('title', 'Eligible Members'); ?>
<?php $__env->startSection('kicker', 'Members allowed to take sacrament'); ?>

<?php $__env->startSection('content'); ?>
    <?php echo $__env->make('partials.module-tabs', ['tabs' => [
        ['label' => 'Participants', 'route' => 'sacrament.index', 'icon' => 'cross'],
        ['label' => 'Register', 'route' => 'sacrament.create', 'icon' => 'plus'],
        ['label' => 'History', 'route' => 'sacrament.history', 'icon' => 'history'],
        ['label' => 'Eligible Members', 'route' => 'sacrament.eligible', 'icon' => 'badge-check'],
    ]], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

    <div class="content-card mb-3">
        <form method="GET" class="row g-3 align-items-end">
            <div class="col-md-8">
                <label class="form-label">Jumuiya / Cell</label>
                <select name="jumuiya_id" class="form-select">
                    <option value="">All Jumuiya</option>
                    <?php $__currentLoopData = $jumuiyas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $jumuiya): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($jumuiya->id); ?>" <?php if((string) request('jumuiya_id') === (string) $jumuiya->id): echo 'selected'; endif; ?>><?php echo e($jumuiya->name); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </div>
            <div class="col-md-4">
                <button class="btn btn-outline-primary w-100"><i data-lucide="filter"></i><span>Filter</span></button>
            </div>
        </form>
    </div>

    <div class="table-card">
        <div class="table-responsive">
            <table class="table">
                <thead><tr><th>Member</th><th>Jumuiya</th><th>Baptized</th><th>Confirmed</th><th>Phone</th></tr></thead>
                <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $members; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $member): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr>
                            <td class="fw-semibold"><a href="<?php echo e(route('members.show', $member)); ?>"><?php echo e($member->full_name); ?></a></td>
                            <td><?php echo e($member->jumuiya?->name ?? '-'); ?></td>
                            <td><?php echo e($member->is_baptized ? 'Yes' : 'No'); ?></td>
                            <td><?php echo e($member->is_confirmed ? 'Yes' : 'No'); ?></td>
                            <td><?php echo e($member->phone ?? '-'); ?></td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr><td colspan="5"><div class="empty-state">Hakuna eligible members kwa filter hii.</div></td></tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>
        <?php echo e($members->links()); ?>

    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/anglican/resources/views/sacrament/eligible.blade.php ENDPATH**/ ?>