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

<?php $__env->startSection('breadcrumb'); ?>

    <div class="container-fluid px-4">
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb my-0">
                <li class="breadcrumb-item"><a href="<?php echo e(route('admin.dashboard.index')); ?>">Anasayfa</a></li>
                <li class="breadcrumb-item <?php if(!$page): ?> active <?php endif; ?>">
                    <?php if($page): ?>
                        <a href="<?php echo e(route('admin.pages.index')); ?>">Sayfalar</a>
                    <?php else: ?>
                        <span>Sayfalar</span>
                    <?php endif; ?>
                </li>
                <?php $__currentLoopData = $ancestors; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ancestor): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <li class="breadcrumb-item"><a
                            href="<?php echo e(route('admin.pages.index', ['id' => $ancestor->id])); ?>"><?php echo e($ancestor->title); ?></a>
                    </li>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php if($page): ?>
                    <li class="breadcrumb-item active"><span><?php echo e($page->title); ?></span></li>
                <?php endif; ?>
            </ol>
        </nav>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>

    <div class="container-lg px-4">

        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('page.create')): ?>
            <div class="row mb-4">
                <div class="d-flex justify-content-end">
                    <?php if(request()->has('id')): ?>
                        <a href="<?php echo e(route('admin.pages.create', ['id' => request()->get('id')])); ?>" class="btn btn-sm btn-primary">
                        <?php else: ?>
                            <a href="<?php echo e(route('admin.pages.create')); ?>" class="btn btn-sm btn-primary">
                    <?php endif; ?>
                    <span class="cil-plus"></span>
                        Yeni <?php echo e(request()->has('id') ? ' Alt Sayfa ('.$page->title.')' : ''); ?>

                    </a>
                </div>
            </div>
        <?php endif; ?>

        <div class="row">
            <div class="col-12">
                <div class="card mb-4">
                    <?php
$__split = function ($name, $params = []) {
    return [$name, $params];
};
[$__name, $__params] = $__split('admin.pages.index', []);

$__html = app('livewire')->mount($__name, $__params, 'lw-1797427531-0', $__slots ?? [], get_defined_vars());

echo $__html;

unset($__html);
unset($__name);
unset($__params);
unset($__split);
if (isset($__slots)) unset($__slots);
?>
                </div>
            </div>
        </div>
    </div>

<?php $__env->startSection('css'); ?>
    <link href="<?php echo e(URL::to('admin/vendors/@coreui/icons/css/free.min.css')); ?>" rel="stylesheet">
    <?php echo \Livewire\Mechanisms\FrontendAssets\FrontendAssets::styles(); ?>

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

<?php $__env->startSection('js'); ?>
<?php echo \Livewire\Mechanisms\FrontendAssets\FrontendAssets::scripts(); ?>

<script src="https://cdn.jsdelivr.net/gh/livewire/sortable@v1.x.x/dist/livewire-sortable.js"></script>

    <script>
        const toastConfig = {
            toast: true,
            position: 'top-end',
            showConfirmButton: false,
            timer: 2000,
            timerProgressBar: true,
        };

        document.addEventListener('livewire:init', () => {
            Livewire.on('deleteTriggered', (event) => {
                swal.fire({
                    title: 'Emin misiniz?',
                    text: 'Bu sayfaya ait tüm alt sayfalar silinecektir ve bu işlem geri alınamaz!',
                    icon: 'warning',
                    showCancelButton: true,
                    confirmButtonText: 'Evet, sil!',
                    cancelButtonText: 'Vazgeç'
                }).then((result) => {
                    if (result.isConfirmed) {
                        Livewire.dispatch('delete', {
                            id: event.id
                        });
                    }
                });
            });

            Livewire.on('showAlert', (event) => {
                Swal.fire({
                    ...toastConfig,
                    text: event[0].text,
                    icon: event[0].icon,
                });
            });
        });
    </script>
<?php $__env->stopSection(); ?>

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

<?php echo $__env->make('admin.layout.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Users/furkanciloglu/Herd/impoholdingpanel/resources/views/admin/pages/index.blade.php ENDPATH**/ ?>