<?php if (isset($component)) { $__componentOriginal1a6cca1fb3b05e19b47840b98800a235 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal1a6cca1fb3b05e19b47840b98800a235 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.layouts.dashboard','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('layouts.dashboard'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::processComponentKey($component); ?>


    <div class="page-shell">

        <div class="page-header">

            <div>
                <span class="eyebrow">
                    Library Access
                </span>

                <h1>
                    Book Access Requests
                </h1>

                <p>
                    Review and track requests for books outside
                    a student's normal class allocation.
                </p>
            </div>

        </div>


        <div class="card">

            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if($requests->count()): ?>

                <div class="table-wrapper">

                    <table class="table-condensed">

                        <thead>
                            <tr>
                                <th>Student</th>
                                <th>Book</th>
                                <th>Reason</th>
                                <th>Requested</th>
                                <th>Status</th>
                                <th></th>
                            </tr>
                        </thead>


                        <tbody>

                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::openLoop(); ?><?php endif; ?><?php $__currentLoopData = $requests; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $accessRequest): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::startLoopIteration(); ?><?php endif; ?>

                                <tr>

                                    <td>
                                        <?php echo e($accessRequest->student?->name); ?>

                                    </td>

                                    <td>
                                        <?php echo e($accessRequest->book?->title); ?>

                                    </td>

                                    <td>
                                        <?php echo e(\Illuminate\Support\Str::limit(
                                            $accessRequest->reason,
                                            65
                                        )); ?>

                                    </td>

                                    <td>
                                        <?php echo e($accessRequest->created_at
                                            ?->format('d M Y')); ?>

                                    </td>

                                    <td>

                                        <?php
                                            $statusClass =
                                                match (
                                                    $accessRequest->status
                                                ) {
                                                    'approved' =>
                                                        'badge--success',

                                                    'pending' =>
                                                        'badge--warning',

                                                    'rejected',
                                                    'expired' =>
                                                        'badge--danger',

                                                    default =>
                                                        'badge--muted',
                                                };
                                        ?>

                                        <span class="badge <?php echo e($statusClass); ?>">
                                            <?php echo e(str(
                                                $accessRequest->status
                                            )->title()); ?>

                                        </span>

                                    </td>

                                    <td>

                                        <a
                                            href="<?php echo e(route(
                                                'school.library.requests.show',
                                                $accessRequest
                                            )); ?>"
                                            class="table-icon-button"
                                        >
                                            <svg viewBox="0 0 24 24">
                                                <path d="M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12Z"/>
                                                <circle cx="12" cy="12" r="3"/>
                                            </svg>
                                        </a>

                                    </td>

                                </tr>

                            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::endLoop(); ?><?php endif; ?><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::closeLoop(); ?><?php endif; ?>

                        </tbody>

                    </table>

                </div>


                <?php echo e($requests->links()); ?>


            <?php else: ?>

                <div class="empty-state">

                    <h2>
                        No access requests
                    </h2>

                    <p>
                        There are currently no requests matching this view.
                    </p>

                </div>

            <?php endif; ?><?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if ENDBLOCK]><![endif]--><?php endif; ?>

        </div>

    </div>

 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal1a6cca1fb3b05e19b47840b98800a235)): ?>
<?php $attributes = $__attributesOriginal1a6cca1fb3b05e19b47840b98800a235; ?>
<?php unset($__attributesOriginal1a6cca1fb3b05e19b47840b98800a235); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal1a6cca1fb3b05e19b47840b98800a235)): ?>
<?php $component = $__componentOriginal1a6cca1fb3b05e19b47840b98800a235; ?>
<?php unset($__componentOriginal1a6cca1fb3b05e19b47840b98800a235); ?>
<?php endif; ?><?php /**PATH C:\Users\Surface pro 4\OneDrive\Desktop\DevOps\literture\literahub\resources\views/school/library/requests/index.blade.php ENDPATH**/ ?>