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

<?php $__env->startSection('content'); ?>
    <section class="card">
        <div class="page-header">
            <p class="eyebrow">Backup Center</p>
            <h1>Backup history across all connected websites</h1>
        </div>

        <form method="get" class="form-grid" style="grid-template-columns: 1fr 1fr auto;">
            <label>
                <span>Status</span>
                <select class="field" name="status">
                    <option value="">Any status</option>
                    <?php $__currentLoopData = ['queued', 'running', 'completed', 'failed', 'restoring']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $status): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($status); ?>" <?php if(($filters['status'] ?? '') === $status): echo 'selected'; endif; ?>><?php echo e(str($status)->headline()); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </label>

            <label>
                <span>Website</span>
                <select class="field" name="website">
                    <option value="">All websites</option>
                    <?php $__currentLoopData = $websites; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $website): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <option value="<?php echo e($website->id); ?>" <?php if((string) ($filters['website'] ?? '') === (string) $website->id): echo 'selected'; endif; ?>><?php echo e($website->name); ?></option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </select>
            </label>

            <div style="display: flex; align-items: end;">
                <button class="button secondary" type="submit">Filter</button>
            </div>
        </form>
    </section>

    <section class="card">
        <div class="table-wrap">
            <table>
                <thead>
                    <tr>
                        <th>Website</th>
                        <th>Status</th>
                        <th>Type</th>
                        <th>Started</th>
                        <th>Size</th>
                        <th>Actions</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__empty_1 = true; $__currentLoopData = $backups; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $backup): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <tr>
                            <td><?php echo e($backup->website->name); ?></td>
                            <td><?php if (isset($component)) { $__componentOriginal8c81617a70e11bcf247c4db924ab1b62 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal8c81617a70e11bcf247c4db924ab1b62 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.status-badge','data' => ['value' => $backup->status]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('status-badge'); ?>
<?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(['value' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($backup->status)]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal8c81617a70e11bcf247c4db924ab1b62)): ?>
<?php $attributes = $__attributesOriginal8c81617a70e11bcf247c4db924ab1b62; ?>
<?php unset($__attributesOriginal8c81617a70e11bcf247c4db924ab1b62); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal8c81617a70e11bcf247c4db924ab1b62)): ?>
<?php $component = $__componentOriginal8c81617a70e11bcf247c4db924ab1b62; ?>
<?php unset($__componentOriginal8c81617a70e11bcf247c4db924ab1b62); ?>
<?php endif; ?></td>
                            <td><?php echo e(str($backup->type)->headline()); ?></td>
                            <td><?php echo e($backup->started_at?->diffForHumans() ?? 'N/A'); ?></td>
                            <td><?php echo e($backup->size_bytes ? \Illuminate\Support\Number::fileSize($backup->size_bytes) : 'Pending'); ?></td>
                            <td>
                                <div class="inline-actions">
                                    <?php if($backup->file_path): ?>
                                        <a class="button ghost" href="<?php echo e(route('backups.download', $backup)); ?>">Download</a>
                                    <?php endif; ?>
                                    <form class="inline-form" method="post" action="<?php echo e(route('backups.destroy', $backup)); ?>" onsubmit="return confirm('Delete this backup?')">
                                        <?php echo csrf_field(); ?>
                                        <?php echo method_field('delete'); ?>
                                        <button class="button danger" type="submit">Delete</button>
                                    </form>
                                </div>
                                <div class="muted" style="margin-top: 0.5rem;">Restore stays disabled until Phase 2.</div>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                        <tr><td colspan="6" class="muted">No backups found.</td></tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>

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

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

<?php echo $__env->make('layouts.panel', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\contol\resources\views/backups/index.blade.php ENDPATH**/ ?>