<?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">
                    Institutional Library
                </span>

                <h1>
                    Digital Library
                </h1>

                <p>
                    Browse books licensed to your institution
                    and available under your current access rights.
                </p>

            </div>


            <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if (\Illuminate\Support\Facades\Blade::check('role', 'school_admin')): ?>

                <a
                    href="<?php echo e(route(
                        'school.library.licenses.catalogue'
                    )); ?>"
                    class="btn btn--primary"
                >
                    Licence Catalogue
                </a>

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

        </div>


        

        <div class="card">

            <form
                method="GET"
                action="<?php echo e(route(
                    'school.library.index'
                )); ?>"
                class="library-filters"
            >

                <input
                    type="search"
                    name="search"
                    value="<?php echo e(request('search')); ?>"
                    placeholder="Search title, author or ISBN..."
                >


                <select name="category">

                    <option value="">
                        All categories
                    </option>

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

                        <option
                            value="<?php echo e($category); ?>"
                            <?php if(
                                request('category')
                                ===
                                $category
                            ): echo 'selected'; endif; ?>
                        >
                            <?php echo e($category); ?>

                        </option>

                    <?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; ?>

                </select>


                <button
                    type="submit"
                    class="btn btn--secondary"
                >
                    Filter
                </button>


                <?php if(\Livewire\Mechanisms\ExtendBlade\ExtendBlade::isRenderingLivewireComponent()): ?><!--[if BLOCK]><![endif]--><?php endif; ?><?php if(
                    request('search')
                    ||
                    request('category')
                ): ?>

                    <a
                        href="<?php echo e(route(
                            'school.library.index'
                        )); ?>"
                        class="btn btn--ghost"
                    >
                        Clear
                    </a>

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

            </form>

        </div>


        

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

            <div class="library-grid">

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

                    <article class="library-book-card">

                        <a
                            href="<?php echo e(route(
                                'school.library.show',
                                $book
                            )); ?>"
                            class="library-book-cover"
                        >

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

                                <img
                                    src="<?php echo e(asset(
                                        'storage/'
                                        . $book->cover_path
                                    )); ?>"
                                    alt="<?php echo e($book->title); ?>"
                                >

                            <?php else: ?>

                                <div class="library-cover-placeholder">

                                    <svg viewBox="0 0 24 24">
                                        <path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/>
                                        <path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2Z"/>
                                    </svg>

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

                                    </span>

                                </div>

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

                        </a>


                        <div class="library-book-body">

                            <div class="library-book-meta">

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

                                    <span>
                                        <?php echo e($book->category); ?>

                                    </span>

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

                                <?php if (isset($component)) { $__componentOriginal3f380d495f99c22111a0f231bf4ba319 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal3f380d495f99c22111a0f231bf4ba319 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.library.book-status','data' => ['status' => $book->status]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('library.book-status'); ?>
<?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(['status' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($book->status)]); ?>
<?php \Livewire\Features\SupportCompiledWireKeys\SupportCompiledWireKeys::processComponentKey($component); ?>

<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal3f380d495f99c22111a0f231bf4ba319)): ?>
<?php $attributes = $__attributesOriginal3f380d495f99c22111a0f231bf4ba319; ?>
<?php unset($__attributesOriginal3f380d495f99c22111a0f231bf4ba319); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal3f380d495f99c22111a0f231bf4ba319)): ?>
<?php $component = $__componentOriginal3f380d495f99c22111a0f231bf4ba319; ?>
<?php unset($__componentOriginal3f380d495f99c22111a0f231bf4ba319); ?>
<?php endif; ?>

                            </div>


                            <h2>

                                <a
                                    href="<?php echo e(route(
                                        'school.library.show',
                                        $book
                                    )); ?>"
                                >
                                    <?php echo e($book->title); ?>

                                </a>

                            </h2>


                            <p class="library-authors">

                                <?php echo e($book->authors
                                    ->pluck('name')
                                    ->join(', ')
                                    ?: 'Unknown author'); ?>


                            </p>


                            <p class="library-description">

                                <?php echo e(\Illuminate\Support\Str::limit(
                                    $book->description
                                    ?: 'No description available.',
                                    110
                                )); ?>


                            </p>


                            <div class="library-book-footer">

                                <span>
                                    <?php echo e($book->language); ?>

                                </span>


                                <a
                                    href="<?php echo e(route(
                                        'school.library.show',
                                        $book
                                    )); ?>"
                                    class="library-open-link"
                                >
                                    View Book
                                </a>

                            </div>

                        </div>

                    </article>

                <?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; ?>

            </div>


            <div class="pagination-shell">
                <?php echo e($books->links()); ?>

            </div>

        <?php else: ?>

            <div class="card empty-state">

                <h2>
                    No books available
                </h2>

                <p>
                    Your current catalogue filters or institutional
                    licence entitlements returned no available titles.
                </p>

            </div>

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

    </div>


    <style>

        .library-filters {
            display: grid;
            grid-template-columns:
                minmax(260px, 1fr)
                190px
                auto
                auto;
            gap: 8px;
        }

        .library-filters input,
        .library-filters select {
            width: 100%;
        }

        .library-grid {
            display: grid;
            grid-template-columns:
                repeat(
                    auto-fill,
                    minmax(190px, 1fr)
                );
            gap: 14px;
        }

        .library-book-card {
            overflow: hidden;
            border: 1px solid var(--color-border);
            border-radius: var(--radius-lg);
            background: var(--color-surface);
        }

        .library-book-cover {
            display: block;
            aspect-ratio: 4 / 3;
            overflow: hidden;
            background: var(--color-surface-soft);
        }

        .library-book-cover img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .library-cover-placeholder {
            height: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 9px;
            padding: 18px;
            color: var(--color-text-muted);
            text-align: center;
        }

        .library-cover-placeholder svg {
            width: 31px;
            height: 31px;
            fill: none;
            stroke: var(--color-primary);
            stroke-width: 1.5;
        }

        .library-cover-placeholder span {
            font-size: .58rem;
        }

        .library-book-body {
            padding: 13px;
        }

        .library-book-meta {
            min-height: 20px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 5px;
        }

        .library-book-meta > span:first-child {
            color: var(--color-primary);
            font-size: .49rem;
            font-weight: 750;
            text-transform: uppercase;
        }

        .library-book-body h2 {
            margin: 7px 0 2px;
            font-size: .74rem;
            line-height: 1.35;
        }

        .library-book-body h2 a {
            color: var(--color-text);
            text-decoration: none;
        }

        .library-authors {
            margin: 0;
            color: var(--color-text-muted);
            font-size: .54rem;
        }

        .library-description {
            min-height: 43px;
            margin: 9px 0;
            color: var(--color-text-muted);
            font-size: .55rem;
            line-height: 1.55;
        }

        .library-book-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 7px;
            padding-top: 9px;
            border-top: 1px solid var(--color-border);
        }

        .library-book-footer span {
            color: var(--color-text-muted);
            font-size: .49rem;
        }

        .library-open-link {
            color: var(--color-primary);
            font-size: .53rem;
            font-weight: 750;
            text-decoration: none;
        }

        .pagination-shell {
            margin-top: 18px;
        }

        @media (max-width: 700px) {

            .library-filters {
                grid-template-columns: 1fr 1fr;
            }

        }

        @media (max-width: 480px) {

            .library-filters {
                grid-template-columns: 1fr;
            }

        }

    </style>

 <?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/index.blade.php ENDPATH**/ ?>