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

<?php $__env->startSection('header'); ?>
    <?php if (isset($component)) { $__componentOriginal111218edafe37a3ff745a947bea8c7e5 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal111218edafe37a3ff745a947bea8c7e5 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.isp-page-header','data' => ['title' => 'Notifications','module' => 'Operations','description' => 'ISP alerts, payments, subscriptions, and system messages.']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('isp-page-header'); ?>
<?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(['title' => 'Notifications','module' => 'Operations','description' => 'ISP alerts, payments, subscriptions, and system messages.']); ?>
         <?php $__env->slot('actions', null, []); ?> 
            <?php if($unreadCount > 0): ?>
                <form method="POST" action="<?php echo e(route('isp.notifications.mark-all-read')); ?>" class="inline">
                    <?php echo csrf_field(); ?>
                    <button type="submit" class="pb-btn">Mark all read</button>
                </form>
            <?php endif; ?>
         <?php $__env->endSlot(); ?>
     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal111218edafe37a3ff745a947bea8c7e5)): ?>
<?php $attributes = $__attributesOriginal111218edafe37a3ff745a947bea8c7e5; ?>
<?php unset($__attributesOriginal111218edafe37a3ff745a947bea8c7e5); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal111218edafe37a3ff745a947bea8c7e5)): ?>
<?php $component = $__componentOriginal111218edafe37a3ff745a947bea8c7e5; ?>
<?php unset($__componentOriginal111218edafe37a3ff745a947bea8c7e5); ?>
<?php endif; ?>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <?php if (isset($component)) { $__componentOriginalff420112e83fb52a8cb508be690fe32b = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalff420112e83fb52a8cb508be690fe32b = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.resource-index','data' => ['filterAction' => route('isp.notifications.index'),'filterChips' => $filterChips ?? [],'exportFormats' => $exportFormats ?? [],'paginator' => $notifications,'empty' => $notifications->isEmpty(),'emptyTitle' => 'No notifications','emptyMessage' => request()->anyFilled(['status', 'type', 'date_from', 'date_to']) ? 'No notifications match your filters.' : 'You are all caught up.']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('resource-index'); ?>
<?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(['filter-action' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(route('isp.notifications.index')),'filter-chips' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($filterChips ?? []),'export-formats' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($exportFormats ?? []),'paginator' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($notifications),'empty' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($notifications->isEmpty()),'empty-title' => 'No notifications','empty-message' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(request()->anyFilled(['status', 'type', 'date_from', 'date_to']) ? 'No notifications match your filters.' : 'You are all caught up.')]); ?>
         <?php $__env->slot('filters', null, []); ?> 
            <div class="min-w-[160px]">
                <label class="isp-form-label">Status</label>
                <select name="status" class="isp-form-select">
                    <option value="">All (<?php echo e($totalCount); ?>)</option>
                    <option value="unread" <?php if(request('status') === 'unread'): echo 'selected'; endif; ?>>Unread (<?php echo e($unreadCount); ?>)</option>
                    <option value="read" <?php if(request('status') === 'read'): echo 'selected'; endif; ?>>Read</option>
                </select>
            </div>
            <?php if (isset($component)) { $__componentOriginaldf4625c685cd48624c5c9a5b5c768d2f = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginaldf4625c685cd48624c5c9a5b5c768d2f = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.listing-filters.select','data' => ['name' => 'type','label' => 'Type','placeholder' => 'All','options' => [
                    'payment' => 'Payment',
                    'subscription' => 'Subscription',
                    'system' => 'System',
                    'hotspot' => 'Hotspot',
                    'success' => 'Success',
                    'warning' => 'Warning',
                    'error' => 'Error',
                    'info' => 'Info',
                ]]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('listing-filters.select'); ?>
<?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(['name' => 'type','label' => 'Type','placeholder' => 'All','options' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute([
                    'payment' => 'Payment',
                    'subscription' => 'Subscription',
                    'system' => 'System',
                    'hotspot' => 'Hotspot',
                    'success' => 'Success',
                    'warning' => 'Warning',
                    'error' => 'Error',
                    'info' => 'Info',
                ])]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginaldf4625c685cd48624c5c9a5b5c768d2f)): ?>
<?php $attributes = $__attributesOriginaldf4625c685cd48624c5c9a5b5c768d2f; ?>
<?php unset($__attributesOriginaldf4625c685cd48624c5c9a5b5c768d2f); ?>
<?php endif; ?>
<?php if (isset($__componentOriginaldf4625c685cd48624c5c9a5b5c768d2f)): ?>
<?php $component = $__componentOriginaldf4625c685cd48624c5c9a5b5c768d2f; ?>
<?php unset($__componentOriginaldf4625c685cd48624c5c9a5b5c768d2f); ?>
<?php endif; ?>
            <?php if (isset($component)) { $__componentOriginal1ecd61a04aebc81c6051cffbc8291375 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal1ecd61a04aebc81c6051cffbc8291375 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.listing-filters.date','data' => ['name' => 'date_from','label' => 'From']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('listing-filters.date'); ?>
<?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(['name' => 'date_from','label' => 'From']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal1ecd61a04aebc81c6051cffbc8291375)): ?>
<?php $attributes = $__attributesOriginal1ecd61a04aebc81c6051cffbc8291375; ?>
<?php unset($__attributesOriginal1ecd61a04aebc81c6051cffbc8291375); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal1ecd61a04aebc81c6051cffbc8291375)): ?>
<?php $component = $__componentOriginal1ecd61a04aebc81c6051cffbc8291375; ?>
<?php unset($__componentOriginal1ecd61a04aebc81c6051cffbc8291375); ?>
<?php endif; ?>
            <?php if (isset($component)) { $__componentOriginal1ecd61a04aebc81c6051cffbc8291375 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal1ecd61a04aebc81c6051cffbc8291375 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.listing-filters.date','data' => ['name' => 'date_to','label' => 'To']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('listing-filters.date'); ?>
<?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(['name' => 'date_to','label' => 'To']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal1ecd61a04aebc81c6051cffbc8291375)): ?>
<?php $attributes = $__attributesOriginal1ecd61a04aebc81c6051cffbc8291375; ?>
<?php unset($__attributesOriginal1ecd61a04aebc81c6051cffbc8291375); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal1ecd61a04aebc81c6051cffbc8291375)): ?>
<?php $component = $__componentOriginal1ecd61a04aebc81c6051cffbc8291375; ?>
<?php unset($__componentOriginal1ecd61a04aebc81c6051cffbc8291375); ?>
<?php endif; ?>
            <?php if (isset($component)) { $__componentOriginal379007f10604674fff3ace02f90f5fae = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal379007f10604674fff3ace02f90f5fae = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.listing-filters.per-page','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('listing-filters.per-page'); ?>
<?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 echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal379007f10604674fff3ace02f90f5fae)): ?>
<?php $attributes = $__attributesOriginal379007f10604674fff3ace02f90f5fae; ?>
<?php unset($__attributesOriginal379007f10604674fff3ace02f90f5fae); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal379007f10604674fff3ace02f90f5fae)): ?>
<?php $component = $__componentOriginal379007f10604674fff3ace02f90f5fae; ?>
<?php unset($__componentOriginal379007f10604674fff3ace02f90f5fae); ?>
<?php endif; ?>
         <?php $__env->endSlot(); ?>

         <?php $__env->slot('table', null, []); ?> 
            <?php if (isset($component)) { $__componentOriginalc8463834ba515134d5c98b88e1a9dc03 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalc8463834ba515134d5c98b88e1a9dc03 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.data-table','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('data-table'); ?>
<?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([]); ?>
                <thead>
                    <tr>
                        <th>When</th>
                        <th>Title</th>
                        <th>Type</th>
                        <th>State</th>
                        <th>Message</th>
                        <th class="text-right">Action</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $notifications; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $notification): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php
                            $badge = match($notification->type) {
                                'success' => 'pb-pill-ok',
                                'warning' => 'pb-pill-warn',
                                'error' => 'pb-pill-bad',
                                'payment' => 'pb-pill-info',
                                'subscription' => '',
                                'system' => '',
                                'hotspot' => 'pb-pill-cyan',
                                default => 'pb-pill-info',
                            };
                        ?>
                        <tr class="<?php echo e($notification->is_read ? '' : 'bg-indigo-50/50 dark:bg-indigo-950/25'); ?>">
                            <td class="whitespace-nowrap text-sm text-slate-500"><?php echo e($notification->created_at->format('M j, H:i')); ?></td>
                            <td class="font-semibold text-slate-900 dark:text-white"><?php echo e($notification->title); ?></td>
                            <td><span class="pb-pill <?php echo e($badge); ?>"><?php echo e(ucfirst($notification->type)); ?></span></td>
                            <td>
                                <?php if($notification->is_read): ?>
                                    <span class="text-slate-400 text-sm">Read</span>
                                <?php else: ?>
                                    <span class="text-xs font-bold uppercase tracking-wide text-indigo-600 dark:text-indigo-300">New</span>
                                <?php endif; ?>
                            </td>
                            <td class="max-w-xs truncate text-sm text-slate-600 dark:text-slate-300" title="<?php echo e($notification->message); ?>"><?php echo e($notification->message); ?></td>
                            <td class="text-right whitespace-nowrap">
                                <?php if(!$notification->is_read): ?>
                                    <form method="POST" action="<?php echo e(route('isp.notifications.mark-read', $notification)); ?>" class="inline">
                                        <?php echo csrf_field(); ?>
                                        <button type="submit" class="text-sm font-semibold text-indigo-600 hover:text-indigo-700 dark:text-indigo-400">Mark read</button>
                                    </form>
                                <?php else: ?>
                                    <span class="text-slate-400 text-sm">—</span>
                                <?php endif; ?>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
             <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalc8463834ba515134d5c98b88e1a9dc03)): ?>
<?php $attributes = $__attributesOriginalc8463834ba515134d5c98b88e1a9dc03; ?>
<?php unset($__attributesOriginalc8463834ba515134d5c98b88e1a9dc03); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc8463834ba515134d5c98b88e1a9dc03)): ?>
<?php $component = $__componentOriginalc8463834ba515134d5c98b88e1a9dc03; ?>
<?php unset($__componentOriginalc8463834ba515134d5c98b88e1a9dc03); ?>
<?php endif; ?>
         <?php $__env->endSlot(); ?>
     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalff420112e83fb52a8cb508be690fe32b)): ?>
<?php $attributes = $__attributesOriginalff420112e83fb52a8cb508be690fe32b; ?>
<?php unset($__attributesOriginalff420112e83fb52a8cb508be690fe32b); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalff420112e83fb52a8cb508be690fe32b)): ?>
<?php $component = $__componentOriginalff420112e83fb52a8cb508be690fe32b; ?>
<?php unset($__componentOriginalff420112e83fb52a8cb508be690fe32b); ?>
<?php endif; ?>
<?php $__env->stopSection(); ?>

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